3

I want to find the size of a MemoryCache.

MemoryCache _cache = MemoryCache.Default;
_cache.Add("key", "value");
FindSize(_cache);

I want to implement the FindSize() method.

Tim M.
  • 53,671
  • 14
  • 120
  • 163
vijayst
  • 20,359
  • 18
  • 69
  • 113

2 Answers2

0

I am afraid you can't find size of .NET object at runtime. See these answers for more details:

Community
  • 1
  • 1
Miroslav Bajtoš
  • 10,667
  • 1
  • 41
  • 99
0

Do you need the _cache.Count() value or something different?

Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78