RFR: JDK-8320300: Adjust hs_err output in malloc/mmap error cases
Thomas Stuefe
stuefe at openjdk.org
Mon Nov 20 13:53:46 UTC 2023
On Fri, 17 Nov 2023 13:53:53 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:
> Some of the error output could be slightly improved. Currently it says for example:
>
> There is insufficient memory for the Java Runtime Environment to continue.
> Native memory allocation (mmap) failed to map 65536 bytes for Failed to commit metaspace.
> Possible reasons:
> . . .
> The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap
>
> The output 'bytes for Failed to commit metaspace.' should be rephrased.
> The reason should be more clear that it really IS the case for the current JVM that CompressedOops is set (and that it is not just some general advice) .
src/hotspot/share/utilities/vmError.cpp line 836:
> 834: st->print(" bytes.");
> 835: if (strlen(_detail_msg) > 0) {
> 836: st->print(" Error detail: ");
I would prefer the more concise form: `(malloc) failed to allocate 4711 bytes (detail detail)`
Note that this change just turns around the weirdness. We have many callers of vm_exit_out_of_memory that just pass in an API name. But I still like your variant better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16707#discussion_r1399233879
More information about the hotspot-dev
mailing list