GC leaks debugging

Erik Groeneveld erik@cq2.nl
Fri Apr 1 08:39:00 GMT 2011


L.S.,

I am debugging memory leaks in the GC of libgcj.  Generally, libgcj
performs well, but there are some cases in which the heap literally
explodes over time. I wish to solve this. The OpenJDK vm runs the same
tests without any leaking.

I compiled GCC 4.6, build with --enable-libgcj-debug=yes and started
testing with GC_DUMP_REGULARLY=1.  From the results I have a few
questions to understand it better.  I am still in a phase of
pinpointing a minimal program to demonstrate the problem, and I would
like to get hints as to search further.

1. The finalization table entries keeps on increasing up to 39344
until it is killed, but the objects which are eligible for immediate
finalization remains 0.  It seems that no finalization takes place.
Could you give any hints as to what could be the reason for this?  It
logs:

***Finalization statistics:
39344 finalization table entries; 48 disappearing links
0 objects are eligible for immediate finalization

***Static roots:
>From 0x804b284 to 0x804bf1c  (temporary)
>From 0xb716d000 to 0xb7854cdc  (temporary)
>From 0xb55ba92c to 0xb562ddbc  (temporary)
Total size: 7716356


2. There is a fair amount of black-listing.  From reading about the
GC, I understand that the GC knows what is a pointer and what not
because there is type information associated with the Java objects.
So I'd expect no black-listing at all.  It that a right observation?
The GC prints this just before it is killed:

***Heap sections:
Total heap size: 355028992
Section 0 from 0x30000 to 0x40000 15/16 blacklisted
Section 1 from 0x40000 to 0x50000 16/16 blacklisted
Section 2 from 0x50000 to 0x60000 16/16 blacklisted
Section 3 from 0x60000 to 0x71000 17/17 blacklisted
Section 4 from 0x71000 to 0x87000 22/22 blacklisted
Section 5 from 0x87000 to 0xa5000 30/30 blacklisted
Section 6 from 0xa5000 to 0xcd000 40/40 blacklisted
Section 7 from 0xcd000 to 0x102000 53/53 blacklisted
Section 8 from 0x112000 to 0x159000 71/71 blacklisted
Section 9 from 0x159000 to 0x1b7000 94/94 blacklisted
Section 10 from 0x1b7000 to 0x235000 83/126 blacklisted
Section 11 from 0x245000 to 0x2ed000 35/168 blacklisted
Section 12 from 0x30d000 to 0x3ed000 43/224 blacklisted
Section 13 from 0x3ed000 to 0x51b000 56/302 blacklisted
Section 14 from 0x53b000 to 0x6ca000 75/399 blacklisted
Section 15 from 0x6da000 to 0x8ee000 75/532 blacklisted
Section 16 from 0x8fe000 to 0xbcb000 61/717 blacklisted
Section 17 from 0xbdb000 to 0xf95000 64/954 blacklisted
Section 18 from 0xfb5000 to 0x14c7000 140/1298 blacklisted
Section 19 from 0x14f7000 to 0x1ba5000 201/1710 blacklisted
Section 20 from 0x1be5000 to 0x23e5000 153/2048 blacklisted
Section 21 from 0x2435000 to 0x2c35000 124/2048 blacklisted
Section 22 from 0x2c75000 to 0x3475000 120/2048 blacklisted
Section 23 from 0x34b5000 to 0x3cb5000 141/2048 blacklisted
Section 24 from 0x3d05000 to 0x4505000 128/2048 blacklisted
Section 25 from 0x4545000 to 0x4d45000 108/2048 blacklisted
Section 26 from 0x4d85000 to 0x5585000 615/2048 blacklisted
Section 27 from 0x55c5000 to 0x5dc5000 214/2048 blacklisted
Section 28 from 0x5e05000 to 0x6605000 1129/2048 blacklisted
Section 29 from 0x6655000 to 0x6e55000 1597/2048 blacklisted
Section 30 from 0x6e95000 to 0x7695000 992/2048 blacklisted
Section 31 from 0x76e5000 to 0x7ee5000 427/2048 blacklisted
Section 32 from 0xb3dea000 to 0xb45ea000 138/2048 blacklisted
Section 33 from 0xb359a000 to 0xb3d9a000 127/2048 blacklisted
Section 34 from 0xb2d4a000 to 0xb354a000 131/2048 blacklisted
Section 35 from 0xb250a000 to 0xb2d0a000 120/2048 blacklisted
Section 36 from 0xb1caa000 to 0xb24aa000 149/2048 blacklisted
Section 37 from 0xb146a000 to 0xb1c6a000 241/2048 blacklisted
Section 38 from 0xb0c1a000 to 0xb141a000 177/2048 blacklisted
Section 39 from 0xb03ca000 to 0xb0bca000 283/2048 blacklisted
Section 40 from 0xafb7a000 to 0xb037a000 609/2048 blacklisted
Section 41 from 0xaf32a000 to 0xafb2a000 152/2048 blacklisted
Section 42 from 0xaeada000 to 0xaf2da000 107/2048 blacklisted
Section 43 from 0xae28a000 to 0xaea8a000 174/2048 blacklisted
Section 44 from 0xada3a000 to 0xae23a000 89/2048 blacklisted
Section 45 from 0xad1ea000 to 0xad9ea000 125/2048 blacklisted
Section 46 from 0xac9aa000 to 0xad1aa000 80/2048 blacklisted
Section 47 from 0xac14a000 to 0xac94a000 117/2048 blacklisted
Section 48 from 0xab90a000 to 0xac10a000 97/2048 blacklisted
Section 49 from 0xab0ba000 to 0xab8ba000 131/2048 blacklisted
Section 50 from 0xaa86a000 to 0xab06a000 108/2048 blacklisted
Section 51 from 0xaa01a000 to 0xaa81a000 201/2048 blacklisted
Section 52 from 0xa97ca000 to 0xa9fca000 81/2048 blacklisted
Section 53 from 0xa8779000 to 0xa8f79000 97/2048 blacklisted
Section 54 from 0xa7f29000 to 0xa8729000 152/2048 blacklisted
Section 55 from 0xa76e9000 to 0xa7ee9000 423/2048 blacklisted
Section 56 from 0xa6e99000 to 0xa7699000 996/2048 blacklisted
Section 57 from 0xa6699000 to 0xa6e99000 1531/2048 blacklisted
Section 58 from 0xa5e09000 to 0xa6609000 1132/2048 blacklisted

***Free blocks:
Free list 60 (Total size 4194304):
	0x7399000 size 1470464 start black listed
	0xa76eb000 size 1159168 start black listed
	0x7501000 size 1564672 start black listed
Total of 4194304 bytes on free list

Could you help me with this?

Best regards,
Erik



More information about the Java mailing list