[Gc] Debugging: getting a list of objects in use dumped

Thomas Aeby aeby at graeff.com
Thu Feb 19 23:54:19 PST 2004


Thanks a lot for your response!

On 19-Feb-2004, Alec Orr <Alec.Orr at wbemsolutions.com> wrote:
> [gcdump]
Unfortunatly GC_dump() only prints the list of used blocks - it prints 
no information on how many objects of what type might be in the 
respective blocks. But I had a look at GC_dump() source code before 
writing my own small dumper (one might not be surprised that it's 
doing nearly the same thing apart from that it's not only listing the
blocks but also iterates through their contents)

On Fri, 2004-02-20 at 00:49, Fergus Henderson wrote: 
> To find those kinds of leaks, you should use the functions defined in
> gc_backptr.h, in particular GC_generate_random_backtrace().

Ok, that was a good hint. I haven't got GC_generate_random_backtrace() since
it's not compiled in in the version of the libgcj I'm using, but the
source code is enlightening - it's just using GC_is_marked() for determining
if an object is in use just like me. So it seems my dumper ought to work
correctly and probably I can trust it's output.

I just can't believe since what I'm seeing can only be caused by a malfunction
of the garbage collector or the runtime environment - I'm seeing uncollected
objects which are only allocated in a local code block with a pointer
pointing to them for maybe 50ms.

Now without backtrace it's pretty hard to find out why they are still marked,
so I won't get around compiling my own GCC/GCJ with GC debugging enabled :-(
(years later ... :-( ... I hate building GCC).

Best regards,
Tom
----------------------------------------------------------------------------
Thomas Aeby, Kirchweg 40, 1735 Giffers, Switzerland, Voice : (+41)26 4180040
Internet: aeby at graeff.com                           PGP public key available
----------------------------------------------------------------------------
A day for firm decisions!!!!!  Or is it?



More information about the Gc mailing list