[9] RFR (XS): 8151623: Zap freed Metaspace chunks in non-product binaries

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Mar 14 18:48:08 UTC 2016


Jon,

Updated version:
   http://cr.openjdk.java.net/~vlivanov/8151623/webrev.03/

> If there is a mistake in the mangling of a Metablock, that would
> show up when the Metaspace shrinks.  Can you check that the testing
> has some Metaspace shrinking.  I think that -Xlog:gc*=trace would
> show the needed output.
Thanks for the hint! It found one problem with -Xlog:gc*=trace itself: 
BlockFreelist keeps the tree of free blocks inside Metachunks and dumps 
the content from the destructor.

Mangling breaks it because it happens earlier and destroys the free list 
structure by the time BlockFreelist destructor is called.

I fixed it by dumping the free list content before Metachunks are 
mangled.

I ran a stress test on class loading and ensured there's no memory leak 
in Metaspace.

Best regards,
Vladimir Ivanov

PS: maybe add a -Xlog:gc,metaspace,freelist=trace event for metachunk 
mangling?


More information about the hotspot-dev mailing list