Question: How to calculate the memory space consumed when cache key store in c#

Answer: 
You can use a memory profiler that is a plugin for visual studio.

<http://blogs.msdn.com/b/dotnet/archive/2013/04/04/net-memory-allocation-profiling-with-visual-studio-2012.aspx>
You can find general information about the memory of your app by querying the garbage collector and cache object. I'm not sure how you can find the exact memory used by the cache, but this is a step in understanding memory consumption of your app.

```
// returns the memory consumption of this process
//  This includes active objects, objects to be disposed, and items within cache.
//  Setting the parameter to 'true' will force a garbage collection before returning the results
GC.GetTotalMemory(false);

// This shows the maximum size available to the cache
//  These limits can be set within the app.config / web.config files
Cache.EffectivePrivateBytesLimit;

```