I have an object that I need to cache several of it for a web app in IIS so I am analyzing how much memory each instance use.
I wrote a small exe
and I call GC.GetTotalMemory(true)
before and after construction and the difference is around 335k but if analyze it in CLR profiler
it shows me 22 MB of memory is used for the object which does not make sense.
What am I interpreting incorrectly in CLR profiler ?
Where should I check in profiler to see individual object sizes ?
According to the MSDN: The garbage collector does not guarantee that all inaccessible memory is collected.
look here
CLR profiler shows all the memory allocated;
What if you use GC.GetTotalMemory(false) what is the result?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With