[Mono-dev] Walking all managed objects

Joe Shaw joe at joeshaw.org
Mon Jul 2 17:51:23 EDT 2007


Hi,

On 7/2/07, Cedric Vivier <cedricv at neonux.com> wrote:
> On 7/2/07, Rodrigo Kumpera <kumpera at gmail.com> wrote:
> >  Heap walking is not supported AFAIK. You could, in theory, implement this
> > feature by extending the garbage collector, but this would require some big
> > mono hacking, which I think you should avoid.
>
> Doesn't heapshot[1] already implement this in some way? (or at least
> it should be a good start)
>
> [1] http://www.mono-project.com/HeapShot

Yeah, as does heap-buddy.  To do this you need to write a profiler
which hooks into the allocation and GC functions and keep track of the
objects yourself.

The heap-shot code for this is pretty straightforward; everything you
need is in heap-shot.c.

Joe



More information about the Mono-devel-list mailing list