VS memory profiler shows decreasing heap size without any GC occuring

425 Views Asked by At

How can .NET managed heap decrease in size without GC occuring? Or should I suspect that Visual Studio 2017 Memory Usage Diagnostic Tools are not 100% reliable?

I'm investigating memory footprint of some loop in my code. So I put breakpoint inside loop and on each hit of the breakpoint I took memory snapshot via Visual Studio 2017 Memory Usage Diagnostic Tools. However instead of seeing addition of objects that are clearly created in the loop I see that objects and memory is 'vanishing':

enter image description here

It can be seen that no GC occured between the snapshots, yet the heap size decreased? Any ideas what can be causing this?

0

There are 0 best solutions below