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 cons开发者_如何学编程istently 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?
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.
精彩评论