Tracking which objects get garbage collected a lot

Code and memory profiling for .NET developers.

Moderators: Brian Donahue, richardjm, StephenC

Tracking which objects get garbage collected a lot

Postby NickWaanders » Mon Sep 08, 2008 11:39 pm

Hi,

I just downloaded your profiler (evaluation), and I've been playing with it a bit.

Currently our biggest goal is to (next to) eliminate all object allocation in our C# code (use pools for everything, etc). I've done a memory profile, but it seems to only give me objects that are currently in memory. I'd like to see the objects that have been collected in between two snapshots, or something of the sorts. Is this possible?

The current method I used is to force a GC, then immediately after do a snapshot, and then looking at the age of objects, assuming all the age 0 objects are the temporary allocations. This works 'ok', but not great (and I'm not even 100% sure it's correct.. :) )

Cheers,
Nick
NickWaanders
 
Posts: 6
Joined: Mon Sep 08, 2008 11:28 pm

Postby StephenC » Tue Sep 09, 2008 9:41 am

I don't know if you have already done this but in the All Classes tab if you right click on one of the column headers and click 'Choose Columns' from the menu you can have additional columns such as 'Removed Count' and 'Removed Size'.

These sound like the kind of measures you are after.

Hope it helps,

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Re:

Postby NickWaanders » Tue Sep 09, 2008 7:53 pm

Oh, haven't tried that yet. Perfect thanks!

Nick
NickWaanders
 
Posts: 6
Joined: Mon Sep 08, 2008 11:28 pm

Postby NickWaanders » Wed Sep 10, 2008 9:10 pm

I've tried it for a few days now, and this does indeed help.

As a suggestion to the devs: It would be great it ANTS 4 could somehow save the column setup so that I don't have to keep adding the 'Removed Count' column every time I do a new memory profile.
NickWaanders
 
Posts: 6
Joined: Mon Sep 08, 2008 11:28 pm

Postby NickWaanders » Fri Sep 12, 2008 1:43 am

Sorry for another reply to this same thread, but one other thing that might be handy is to show objects types that were allocated in the past, but were all removed from the garbage collector. Currently if I am not mistaking you can only show the remove count from currently active objects..

EDIT: duh, ignore that. Objects with live count 0 show up as well...


Cheers,
Nick
NickWaanders
 
Posts: 6
Joined: Mon Sep 08, 2008 11:28 pm


Return to ANTS Profiler Previous Versions

Who is online

Users browsing this forum: No registered users and 0 guests