RFR: 8267404: vmTestbase/vm/mlvm/anonloader/stress/oome/metaspace/Test.java failed with OutOfMemoryError [v3]

Igor Ignatyev iignatyev at openjdk.java.net
Mon May 24 06:43:43 UTC 2021


On Fri, 21 May 2021 15:19:17 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Hi all,
>> 
>> vmTestbase/vm/mlvm/anonloader/stress/oome/metaspace/Test.java OOMEs on Oracle's aarch64 platforms.
>> The reason is that both -Xmx and -XX:MetaspaceSize are not enough.
>> 
>> From the original JBS decription of JDK-8267404, the VM OOMEs before the expected OOME in metaspace happened showing that -Xmx256m is not enough.
>> 
>> Then, @dcubed-ojdk helped me test with -Xmx512, which still OOMEs.
>> However, the expected OOME in metaspace was caught this time.
>> But a second uncaught OOME in metaspace happened soon, which means -XX:MetaspaceSize=8m is not enough.
>> 
>> So both -Xmx and -XX:MetaspaceSize should be increased.
>> The fix just:
>>   - Revert changes about mataspace size setting
>>   - Increase -Xmx from 256m to 1g
>> 
>> -Xmx512m may be OK on Oracle's aarch64 machines, but to make it safer, -Xmx1g is preferred.
>> 
>> Thanks.
>> Best regards,
>> Jie
>
> Jie Fu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Increase MaxMetaspaceSize to 512k

well, although I agree that the test might have done a better job explaining its purpose, it did have a javadoc: `This test loads classes using defineHiddenClass and stores them, expecting Metaspace OOME`  and its location (`vm/mlvm/anonloader/stress/oome/metaspace`) suggests that it's a test for anonymous classloader (it used to use `Unsafe::defineAnonymousClass` till it get removed) part of mlvm (jsr292), and it's supposed to stress metaspace in near OOME state, so it's unfair to say it didn't state its purpose at all.

I haven't followed this RFR thread closely, so I can't suggest you the way to fix the test, but I strongly advise you to restore its logic, that's to say backout `6288a9936cc7e69cab0cc5f3e49c803f184bf2ca` and work on the proper fix which will preserve the original intent of the test.

-- Igor

after spending some time looking at the original test, I'm wondering if we need `-Xmx`, `-XX:MaxMetaspaceSize`, `-XX:MetaspaceSize` at all.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4140


More information about the hotspot-runtime-dev mailing list