RFR: 8358748: Large page size initialization fails with assert "page_size must be a power of 2" [v4]
Yagmur Eren
duke at openjdk.org
Tue Aug 19 11:27:51 UTC 2025
> The VM now exits gracefully if `-XX:LargePageSizeInBytes` is set to a non power of two value, instead of asserting. After this change, `SizeTTest.java` failed because the tested values are not valid for `-XX:LargePageSizeInBytes` (`LargePageSizeInBytesConstraintFunc` returns `JVMFlag::VIOLATES_CONSTRAINT`). Therefore, I updated the test to use `NUMASpaceResizeRate`, since I believe that it only requires a flag of type `size_t`.
>
> Before the change:
>
> java -XX:+UseLargePages -XX:LargePageSizeInBytes=6 -version
>
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (workspace/open/src/hotspot/share/runtime/os.cpp:2449), pid=1885945, tid=1885946
> # assert(is_power_of_2(page_size)) failed: page_size must be a power of 2: 0x6
>
>
>
> After the change:
>
> java -XX:+UseLargePages -XX:LargePageSizeInBytes=6 -version
>
> LargePageSizeInBytes ( 6 ) must be a power of 2
> Improperly specified VM option 'LargePageSizeInBytes=6'
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
Yagmur Eren has updated the pull request incrementally with one additional commit since the last revision:
change the flag in sizet test
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25994/files
- new: https://git.openjdk.org/jdk/pull/25994/files/d5fdb70b..6dfa4a29
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25994&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25994&range=02-03
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/25994.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25994/head:pull/25994
PR: https://git.openjdk.org/jdk/pull/25994
More information about the hotspot-runtime-dev
mailing list