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

Jon Masamitsu jon.masamitsu at oracle.com
Tue Mar 15 21:46:34 UTC 2016



On 3/14/2016 11:48 AM, Vladimir Ivanov wrote:
> Jon,
>
> Updated version:
>   http://cr.openjdk.java.net/~vlivanov/8151623/webrev.03/

Looks good.

>
>> 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?
Hopefully the mangling will be an uninteresting event.  I didn't see 
trace events in
other mangling code so I'd say wait and see if it is ever missed.

Jon





More information about the hotspot-dev mailing list