什么样的泄漏会导致WCF中TimeBoundedCache.ExpirableItem的实例泄漏?
我使用 .NET Memory Profiler 分析了我的 WCF 应用程序,发现存在 TimeBoundedCache.ExpirableItem 和 Byte[] 类型的实例泄漏:
使用间隔为1小时的两张快照进行比较,不同时间的比较也显示出两种类型的数量持续增加。除这两种类型外,没有明显的泄漏。
分配堆栈如下所示:
有人知道可能是什么原因造成的吗?
I profiled my WCF application using the .NET Memory Profiler, and found that there is instance leak of types TimeBoundedCache.ExpirableItem and Byte[]:
The comparison was made using two snapshot with 1 hour interval, and comparisons at different times also show the consistently increasing number of the two type. Other than those two types, there is no apparent leak.
The allocation stack looks like this:
Does anyone recognize what might be causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
WCF 安全堆栈中的各种安全令牌缓存实现都使用它。我猜您的客户端配置了 < code>CacheIssuedTokens 功能?
该缓存将由在后台线程上运行的清除进程定期清理,因此您无需担心它永远泄漏。但是,您确实需要意识到,如果您的流程中有多个客户端都拥有自己的安全令牌,那么这种情况会随着时间的推移而增加。
This is used by various security token cache implementations within the WCF security stack. I'm guessing your client is configured with the
CacheIssuedTokens
feature?This cache will be routinely cleaned up by a purging process that runs on a background thread, so you don't need to worry about it leaking forever. However, you do need to realize that if you have several clients in your process all with their own security tokens, this will build up over time.