RFR: 8366980: TestTransparentHugePagesHeap.java fails when run with -UseCompressedOops
Stefan Karlsson
stefank at openjdk.org
Mon Sep 8 12:39:51 UTC 2025
The new test TestTransparentHugePagesHeap.java added in [JDK-8366434](https://bugs.openjdk.org/browse/JDK-8366434) fails when run with -UseCompressedOops.
The reason for this is that the address printed as the start of the heap in the pagesize logging is not the start of the mapping. So we fail to find the mapping when scanning the SMAPS file.
There reason why this happens is that Linux has merged the memory area for the heap with some other memory. Sometimes it is the marking bitmaps and sometimes it's just malloc that mapped some memory.
I propose that we change the test to find the smaps memory area that contains the start address of the heap and verify that that area is THP eligible.
I'm using BigInteger to represent the parsed addresses to skip having to deal with negative values in longs.
Tested locally with the reproducer. I'm also testing with tier1 and the tier that found this issue.
The fix is localized in TestTransparentHugePagesHeap.java so that it can easily be incorporated into a backport of JDK-8366434.
-------------
Commit messages:
- Simplify
- Match overlapping ranges
Changes: https://git.openjdk.org/jdk/pull/27143/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=27143&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8366980
Stats: 49 lines in 1 file changed: 27 ins; 2 del; 20 mod
Patch: https://git.openjdk.org/jdk/pull/27143.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/27143/head:pull/27143
PR: https://git.openjdk.org/jdk/pull/27143
More information about the hotspot-gc-dev
mailing list