Page 1 of 1

How can I find out what is keeping Foo alive?

Posted: Thu Jun 21, 2012 7:53 am
by andyb1979
Hi there,

I recently created a question on StackOverflow, asking if there were any commercial programs that could tell me what is keeping a certain class alive?

Please see the question here:
http://stackoverflow.com/questions/1113 ... ce-to-what

Can MemProfiler help me with this problem?

Best regards,
Andrew

Re: How can I find out what is keeping Foo alive?

Posted: Thu Jun 21, 2012 12:24 pm
by Andreas Suurkuusk
Yes, .NET Memory Profiler will help you find out what is keeping Foo alive. If you run your program under .NET Memory Profiler (e.g. by using the "Profile application" command), you will be able to collect snapshots of the managed memory. From the Overview table you can the show the details of the Foo type (by double-clicking). A list of live instances of the Foo type will be presented, and by double-clicking an instance you will see the details of the instance. The details include an instance graph that will provide information about why the instance has not been GCed.