Page 1 of 1

garbage collection

Posted: Mon Feb 02, 2015 2:07 am
by mksup
When I take a snap shot, does the memory profiler do a garbage collection?

Re: garbage collection

Posted: Mon Feb 02, 2015 11:30 pm
by Andreas Suurkuusk
Yes, when you collect a heap snapshot the profiler performs several full garbage collections, and waits for finalizers, in order to allow the .NET runtime to clean up as much memory as possible.If you don't want to clean-up the memory before the snapshot, you can use the command "Profiler->Collect gen #0 snapshot". This command causes a single generation #0 GC to be performed while collecting the snapshot. The snapshot will then usually contain unreachable instances and instances that are waiting for finalization.