Should OutOfMemoryError from NIO direct memory honor JVM flags for handling OOME?

Man Cao manc at google.com
Thu Sep 22 23:26:38 UTC 2022


Hi all,

I recently opened an RFE (https://bugs.openjdk.org/browse/JDK-8294052) to
make JVM flags such as -XX:+HeapDumpOnOutOfMemoryError and
-XX:+ExitOnOutOfMemoryError work for OutOfMemoryErrors from filling up the
NIO direct memory.
Supporting HeapDumpOnOutOfMemoryError would greatly help users debug OOMEs
from NIO direct memory. In our case, the OOMEs from direct memory are
infrequent and unpredictable, and it is quite infeasible to
manually trigger a heap dump just before those OOMEs happen.

However, [~dholmes] seems a bit wary of supporting those JVM flags for NIO
direct memory, as those JVM flags are currently for OOMEs thrown from the
JVM, and for OOMEs about Java heap and metaspace, which are both managed by
the JVM.

Do you think it is a good idea to support those JVM flags for OOMEs from
NIO direct memory? Are there any concerns that we shouldn't support them?

-Man
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/nio-dev/attachments/20220922/24122b1a/attachment.htm>


More information about the nio-dev mailing list