Unconditional messages on large page reservation errors

Thomas Stüfe thomas.stuefe at gmail.com
Sat Apr 17 04:11:25 UTC 2021


Hi all,

In os::reserve_memory_special, we print unconditional warnings to stderr in
case large page reservation fails. Unconditional printouts like these can
interfere with parsers parsing VM output, and can accumulate and cause high
memory footprint (see e.g. https://bugs.openjdk.java.net/browse/JDK-8265332
).

Large page reservations may fail at any time os::reserve_memory_special()
function is called, e.g. because the large page pool is temporarily
exhausted. And os::reserve_memory_special() is a general purpose function,
not only used for the heap. Running out of large pages is not fatal, since
the caller can just fall back to normal page allocation. Which is what we
do when reserving the java heap. I think unconditional printouts should
only happen in case of fatal errors, when the VM is about to die.

The unconditional warning probably made sense in the context of reserving
the java heap, if the user explicitly specified UseLargePages. I propose to
change this to either
- if large page allocation for the heap fails, trace with info level
and fall back to small pages. Leave it up to the user to increase UL and
monitor log output to find out about this. This is what we usually do when
system APIs fail.
- continue printing the message with error level, but exit the VM. If
it's serious enough to unconditionally notify the user, it's serious enough
to stop the VM.

I prefer the former. What do you think?

Thanks and best Regards,

Thomas



More information about the hotspot-gc-dev mailing list