Finding out what the GC cleared the most?

Memory profiling for .NET developers

Moderators: Luke Jefferson, StephenC, AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Finding out what the GC cleared the most?

Postby mlaban » Fri Apr 01, 2011 6:42 pm


I noticed that my app is allocating lots of small value types and that causes the garbage collector to run a bit more than I'd like it to.

Is there a way in the memory profiler to figure out what the collected objects were? I can only figure out what is still in memory.

My app is a game and I'm suspecting the allocations of all those value types during the update/render methods which are run at 60fps, so I can't really make snapshots before and after the methods...

Posts: 1
Joined: Fri Apr 01, 2011 6:37 pm

Using the snapshot API

Postby jrg » Mon Apr 04, 2011 11:02 am

You could use the snapshot API

to take a snapshot before and after the function call.

The snapshots would have to be conditional so that they only ran once, to avoid attempting 60 snapshots per second.
Posts: 13
Joined: Fri Jul 02, 2010 3:13 pm

Postby Brian Donahue » Mon Apr 04, 2011 12:05 pm

I take it since you can't take snapshots, you need an alternate way of getting Garbage Collection stats? Maybe Windbg/sos can help?
Brian Donahue
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Return to ANTS Memory Profiler 7

Who is online

Users browsing this forum: No registered users and 0 guests