[Mono-devel-list] [PATCH] GC Profiling Interfaces

Ben Maurer bmaurer at ximian.com
Sat Jan 22 21:30:34 EST 2005


Hey guys,

This is the patch that is being used for the heap profiler. I would like
to get this into the main repo, so that people don't have to patch the
tree.

This patch allows the profile to:

      * Get a call back during every gc. During the call back:
              * The world is stopped
              * Mark bits are set
              * Objects that do not have the mark bit set are still
                intact (ie, they have not bee been cleared
        The goal here is to allow the profiler to do a quick heap walk,
        so that it can see what is still alive. Paolo before commented
        that it would be better to make this a generalized heap walk.
        However, this ends up being less useful for my profiler -- I
        need to store some extra data for each object (the backtrace of
        who allocated it). So, if I did a generalized heap walk, I would
        need to store this information in a hashtable. Also, the heap
        walk would tell me who *survived* each gc. But what I want to
        know is who *died* in each gc. So I have to do even more work.
        This just ends up being more useful.
      * Test the mark bit for any object -- only useful during the above
        callback.
      * Get a callback each time the heap is resized
      * Query the (upper bound on) the number of live bytes and the size
        of the GC heap at any time.

Note that some of these are wrappers around the GC_* functions, because
we don't export them due to mono/mono/mini/ldscript.

-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mono.patch
Type: text/x-patch
Size: 5934 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050122/0902348e/attachment.bin 


More information about the Mono-devel-list mailing list