RFR: 8064909: FragmentMetaspace.java got OutOfMemoryError

Dmitry Fazunenko Dmitry.Fazunenko at oracle.com
Wed Nov 26 20:51:32 UTC 2014

Hi Jon,

The original version of test worked for 80 seconds trying to perform as 
many iterations as possible. The number of iterations performed depended 
on how fast is the machine. With each next iteration the size of 
generated and loaded classes is growing, so on fast enough machines 80 
seconds is enough to run out of heap while generating a class.

The fix not only sets the heap, but limits iterations.  300m heap is 
enough for 200 iterations.

Your approach, with catching OOME(heap) and passing will also work, but 
it will reduce the test readability (and potentially could bring more 

An alternative approach would be to limit metaspace and heap accordingly 
and load classes until we don't run out metaspace... But this might take 

So, I hope that Michael's fix is good.

Thanks for looking and expressing comments.

On 26.11.2014 22:04, Jon Masamitsu wrote:
> Michail,
> Your change makes this test pass but it seems like at
> some future date 300m might not be big enough
> (for whatever reason).  Could the test be make to
> caught an OOME, print out a message saying that
> an OOME doesn't mean the test failed  but that
> the test needs a larger heap?  Then pass an
> exception up (maybe some type of Runtime
> exception - sorry if that is vague but I don't
> what type of exception would make sense).  That
> would mean we wouldn't have to spend time
> diagnosing what the OOME means again.
> Jon
> On 11/26/2014 5:36 AM, Michail Chernov wrote:
>> Hi,
>> Please review this simple fix for nightly test failure:
>> Webrev:
>> http://cr.openjdk.java.net/~eistepan/~mchernov/8064909/webrev.00/
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8064909
>> Problem: test fails because of OOME (not enough heap size).
>> Solution: heap size were increased.
>> Testing:
>> jtreg
>> Thanks,
>> Michail

More information about the hotspot-gc-dev mailing list