How to debug the GC
Jeff Sturm
jsturm@one-point.com
Tue Jun 17 16:43:00 GMT 2003
On 2003年6月17日, Jost Boekemeier wrote:
> For each new round ca. 200K (sometimes more, sometimes less) are missing so
> that after some time the GC will allocate a new chunk from the OS. -- This
> does not mean that there is a bug within the GC; we use several native
> methods which may cause this.
>> Does anyone have a tip how to debug this kind of problem? In gcj how do I
> access the list of referenced objects?
There are some debugging tools available in the GC. In these situations
I like to rebuild my boehm-gc dir without -DSILENT so it dumps more
information at collection points.
Watch out for excessive blacklisting, especially if you are allocating
large arrays.
>From within gdb you can call GC_dump() to output various data structures
used by the GC. You can also call it from native code.
If you need any help interpreting the output, post samples here or the GC
list: http://linux.hpl.hp.com/cgi-bin/mailman/listinfo/gc
> Btw: I've taken a short look at the GC and it seems that the GC does never
> release memory back to the operating system, does it?
Not in its default configuration. You can build with -DUSE_MUNMAP on some
platforms. However it may not work as effectively as you want it to; for
instance it can only free heap blocks that are not fragmented, i.e.
contain zero live objects.
Jeff
More information about the Java
mailing list