Red Gate forums :: View topic - Tracking which objects get garbage collected a lot
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Profiler Previous Versions
ANTS Profiler Previous Versions forum

Tracking which objects get garbage collected a lot

Search in ANTS Profiler Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
NickWaanders



Joined: 08 Sep 2008
Posts: 6

PostPosted: Mon Sep 08, 2008 11:39 pm    Post subject: Tracking which objects get garbage collected a lot Reply with quote

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.. Smile )

Cheers,
Nick
Back to top
View user's profile Send private message
StephenC



Joined: 15 Oct 2007
Posts: 315
Location: Cambridge

PostPosted: Tue Sep 09, 2008 9:41 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
NickWaanders



Joined: 08 Sep 2008
Posts: 6

PostPosted: Tue Sep 09, 2008 7:53 pm    Post subject: Re: Reply with quote

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

Nick
Back to top
View user's profile Send private message
NickWaanders



Joined: 08 Sep 2008
Posts: 6

PostPosted: Wed Sep 10, 2008 9:10 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NickWaanders



Joined: 08 Sep 2008
Posts: 6

PostPosted: Fri Sep 12, 2008 1:43 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group