Determine where short-lived objects are being created

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
Posts: 1
Joined: Thu May 21, 2009 9:01 pm

Determine where short-lived objects are being created

Post by robert » Thu May 21, 2009 9:07 pm

I have a large number of objects which are being continuously created, as evidenced by the RealTime view. However, they are all being cleanup up by the GC process when I create a memory snapshot.

How can I use .Net MP identify where these objects are being created?


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

Post by Andreas Suurkuusk » Fri May 22, 2009 3:19 pm

After collecting a snapshot you can use the "Allocs/sec" (or "Bytes/sec") column to get information about the classes that have a lot of allocations. You can then double click on a class to get the details about the who's performing the allocations. Under the "Allocation stacks" tab you can select "Sort stacks by: Allocs/sec" and you will get information about who creates the short-lived instances.

You can also use the "Call stacks/Methods" view to get allocation information for all classes (not just one selected class). Just select "Sort stacks by: Allocs/sec" here as well.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests