On Wed, 18 Mar 2026 09:58:05 GMT, Thomas Stuefe <[email protected]> wrote:

>> Good catch. That is wrong, I accidentally cut away the comparison.
>> 
>> This is only used when putting together the text for a Metaspace OOM. Seems 
>> our tests did not pick up on that, might look into that.
>
> Hah.
> 
> 
> hotspot/jtreg/runtime/Metaspace/MaxMetaspaceSizeTest.java
> 46:        // "OutOfMemoryError: Metaspace" or
> 48:        output.shouldMatch("OutOfMemoryError.*(Compressed class 
> space|Metaspace)");
> 
> 
> Yeah, I will improve the test.

Hmm, looked into rewriting MaxMetaspaceSizeTest to explicitly test OOMs for 
CompressedClassSpace. 

Problem is we have a minimum size for class space, which equals the size of a 
metaspace ROOT node, which is 16MB. To fill up that space the tests needs to 
load about 9000 classes of average size, and that takes abouta  minute. This is 
too long for a test. Also, the test would be highly vulnerable to future 
improvements that e.g. shrink Klass size.

So I decided to just live with the test as it is now.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28366#discussion_r2952568449

Reply via email to