Options

Tracking which objects get garbage collected a lot

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

Comments

  • Options
    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
  • Options
    Oh, haven't tried that yet. Perfect thanks!

    Nick
  • Options
    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.
  • Options
    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
Sign In or Register to comment.