GC leaks debugging

Erik Groeneveld erik@cq2.nl
Tue Apr 5 12:02:00 GMT 2011

>> I have done many tests, with different programs, which all run
>> flawlessly on OpenJDK, but explode on GCJ.  I have run some test last
>> night, and I'll see from the logs that the heap is 1 GB, while about
>> 700 MB of it is free.
> That sounds like it's working perfectly, then.  What is the problem?

The problem is that the tests don't use much memory at all, but the
heap keeps expanding, the collection cycles become less frequent and
take longer and longer.  Even on a system with 64GB, it just fills it

This particular test repeats 13 million times the same code before it
gets killed by OOM killer.  The logs says, just before the kill (sizes
in MB by me):

-----------------------begin log-----------------------
 ***Finalization statistics:
 55286 finalization table entries; 55 disappearing links
 0 objects are eligible for immediate finalization

 ***Static roots:
 From 0x603000 to 0x603480  (temporary)
 From 0x7f81d5a00000 to 0x7f81d6349d48  (temporary)
 From 0x7f81d3069000 to 0x7f81d31b3c80  (temporary)
 Total size: 11095624 (10 MB)

 ***Heap sections:
 Total heap size: 959184896 (914 MB)
 Section 0 from 0x7f81d1503000 to 0x7f81d1513000 0/16 blacklisted
 Section 1 from 0x7f81d14e3000 to 0x7f81d14f3000 0/16 blacklisted
 // more, only few blacklisted
 Section 130 from 0x7f81957ce000 to 0x7f8195fce000 0/2048 blacklisted
 Section 131 from 0x7f8194f8e000 to 0x7f819578e000 0/2048 blacklisted

 ***Free blocks:
 Free list 2 (Total size 8192):
     0x7f81a9f94000 size 8192 not black listed
 Free list 5 (Total size 10444800):
     0x7f81a98c8000 size 20480 not black listed
     0x7f81a9aee000 size 20480 not black listed
     // many, many more
 Free list 60 (Total size 5775360):
     0x7f8195358000 size 4415488 not black listed
     0x7f81a306b000 size 1359872 partially black listed
 Total of 672296960 bytes on free list  (641 MB)

 ***Blocks in use:
     // cut
 blocks = 67177, bytes = 286887936  (273 MB)

 ***Finalization statistics:
 38070 finalization table entries; 55 disappearing links
 0 objects are eligible for immediate finalization
-----------------------end log-----------------------

The tests work fine on OpenJDK.  What could cause GCJ to grow the heap


PS Even compressed, the complete log is over the mailing-list allowed
attachment size, so I gave an extract.

More information about the Java mailing list