[9] RFR(M): 8054292 : code comments leak in fastdebug builds
David Chase
david.r.chase at oracle.com
Fri Aug 22 21:24:30 UTC 2014
webrev: http://cr.openjdk.java.net/~drchase/8054292/webrev-for-leak-checks.09/
bug: (confidential) https://bugs.openjdk.java.net/browse/JDK-8054292
description: CodeBuffers and BufferBlobs leak code comment strings in fastdebug.
This can be seen with the KitchenSink internal test or with CompileTheWorld:
w/ CodeBuffer strings freed, BufferBlobs flushed to free strings and oopmaps:
Total: reserved=5,908,975KB, committed=713,911KB
- Code (reserved=251,478KB, committed=22,442KB)
(malloc=3,798KB #82,818)
(mmap: reserved=247,680KB, committed=18,644KB)
no leak plugging:
Total: reserved=6,031,728KB, committed=836,404KB
- Code (reserved=340,883KB, committed=111,587KB)
(malloc=93,203KB #221,6790)
(mmap: reserved=247,680KB, committed=18,384KB)
With these leaks fixed (this includes a possible oopmap leak)
KitchenSink still leaks about about 6MB/hour on a not-too-old
6MB/hour Linux box, but this leak appears to be plugged.
(KitchenSink is running over the weekend with NMT detail
turned on to identify the next leak. The old code leaked
at least 25MB/hour on this box.)
Fix:
Free memory in appropriate places.
Insert asserts to guard against reuse of freed memory.
Testing:
JPRT, jtreg, CompileTheWorld, KitchenSink, quicktest
jtreg included testing with -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
to help guard against the case of prematurely freed pointers.
Other testing involved freeing more aggressively at the use sites,
and then asserting whenever the destructor was run w/o memory
having been freed.
One client of CodeBuffers allocates them without running their constructor,
which interfered with enabling the full set of assertions that we might like.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140822/3ead1210/signature-0001.asc>
More information about the hotspot-compiler-dev
mailing list