garbage collection

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
mksup
Posts: 1
Joined: Mon Feb 02, 2015 2:06 am

garbage collection

Post by mksup » Mon Feb 02, 2015 2:07 am

Hi,
When I take a snap shot, does the memory profiler do a garbage collection?

Andreas Suurkuusk
Posts: 1000
Joined: Wed Mar 02, 2005 7:53 pm

Re: garbage collection

Post by Andreas Suurkuusk » Mon Feb 02, 2015 11:30 pm

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.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 6 guests