On Fri, 7 Aug 2026 11:32:13 GMT, Sorna Sarathi N <[email protected]> wrote:
> The test was using a fixed -XX:MaxMetaspaceSize=25m for all platforms. > Investigation (via jcmd VM.metaspace) revealed that the higher limit is > needed only on platforms where CDS is unavailable (e.g. AIX). Without CDS, > all 3,340 classes are allocated in classic metaspace (~23.4 MB committed), > whereas on Linux with CDS active, 1,364 core JDK classes are mapped from the > shared archive into a separate "Shared Class Space" that does not count > against -XX:MaxMetaspaceSize, keeping classic metaspace usage at ~13.6 MB. > > This was validated by running the test on Linux with -Xshare:off > -XX:MaxMetaspaceSize=17m, which reproduces the same OOM as AIX. When running > with 25m, the usage is very similar to AIX. > > This change splits the test into two variants based on CDS availability: > >> id=cds (@requires vm.cds): runs with -XX:MaxMetaspaceSize=17m > id=nocds (@requires !vm.cds): runs with -XX:MaxMetaspaceSize=25m > > An explanatory comment is also included so the reasoning is clear to future > readers. > > JBS Issue: [JDK-8336666](https://bugs.openjdk.org/browse/JDK-8336666) > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This looks good. ------------- Marked as reviewed by sspitsyn (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/32254#pullrequestreview-4888372790
