Is there a way to find the number of bytes of memory that are currently in HttpContext.Cache?
I found where you can get the physical memory limit using EffectivePrivateBytesLimit or EffectivePercentagePhysicalMemoryLimit, but it's hard for me to find the current use of physical memory.
Any ideas?
--- UPDATE ---
And a few more searches and using the first answer mentioning http://aspalliance.com/cachemanager/ , I went to this page, at the bottom there is a link to http://www.codeproject.com/aspnet/exploresessionandcache.asp , which describes the method calculating the size of the object, which, in my opinion, will be good enough to use.
It basically serializes every object in the cache, and then finds the length of the serialized stream. Summing these values leads to some information that I can use.
source
share