RFR 8015391: NPG: With -XX:+UseCompressedKlassPointers OOME due to exhausted metadat, a space could occur when metaspace is almost empty

Mikael Gerdin mikael.gerdin at oracle.com
Thu Jun 20 13:19:55 PDT 2013


Coleen,
this is not a final review, just some comments on the methodology on how 
we make this kind of changes.

On 06/20/2013 06:26 PM, Coleen Phillimore wrote:
> Summary: Allocate medium chunks for class metaspace when class loader
> has lots of classes
>
> I originally made class metaspace keep small chunks and not start
> allocating from medium chunks, because I thought with only Klass
> objects, small chunks is enough.  This test has a large set of class
> loaders who have a lot of classes, so allocated thousands of small
> chunks each.  Class loaders with that many classes should start
> allocating from medium chunks, for class metaspace.

Can you describe exactly how making use of medium chunks for class 
metaspace increases the memory efficiency.
* Is it because of the overhead of each chunk?
* Is it because the small size of the chunks lead to wasted memory at 
the end of each chunk?
* Any other reason which I didn't mention?

In the second case, can you please try with my fix for JDK-8009561?
The webrev is at http://cr.openjdk.java.net/~mgerdin/8009561/webrev.0/
and http://cr.openjdk.java.net/~mgerdin/8009561/webrev.0%2b/

I know you lurk on gc-dev so search for "Request for review: JDK-8009561 
NPG: Metaspace fragmentation when retiring a Metachunk"

:)

>
> I also increased the ClassMediumChunk size to 4k and measured a lot less
> fragmentation waste than 1K or 2K for this test.  Lastly, the
> AppClassLoader instance should have as large of an initial metaspace as
> the bootclass loader.

Fragmentation in the general case or on a specific (possibly degenerate) 
test case?
I think we need to be careful here not to optimize for some strange test 
which just loads a lot of classes and does nothing useful.
No matter what allocation policy / chunk sizes we come up with there's 
always a way to design a test which will cause bad behavior.

>
> Tested with vm.quick.testlist and the failing test.
>
> open webrev at http://cr.openjdk.java.net/~coleenp/8015391/

The changes to the preallocated exception oops are sane but should 
probably be done as a separate change...


/Mikael

> bug link at http://bugs.sun.com/view_bug.do?bug_id=8015391
> local bug link https://jbs.oracle.com/bugs/browse/JDK-8015391
>
> Thanks,
> Coleen
>



More information about the hotspot-dev mailing list