<div dir="ltr">My opinion? Yes, these flags should work for all kind of OOMEs that indicate a real resource exhaustion, regardless of its point of origin. Our users don't care, they just want their heap dumps to work reliably.<div><br></div><div>But its an unsolved point of contention. We have tried to get this into the OpenJDK repeatedly, but failed to convince Oracle. Therefore we gave up and changed behavior in our downstream JVMs:</div><div><br></div><div><a href="https://github.com/SAP/SapMachine/wiki/Handling-of-OnOutOfMemoryError-switches-in-the-SapMachine">https://github.com/SAP/SapMachine/wiki/Handling-of-OnOutOfMemoryError-switches-in-the-SapMachine</a><br></div><div><br></div><div>which is always regrettable - tiny steps toward fragmentation of the JVM landscape. But we needed to make our users happy.</div><div><br></div><div>Cheers, Thomas</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 23, 2022 at 1:27 AM Man Cao <<a href="mailto:manc@google.com">manc@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div>I recently opened an RFE (<a href="https://bugs.openjdk.org/browse/JDK-8294052" target="_blank">https://bugs.openjdk.org/browse/JDK-8294052</a>) to make JVM flags such as -XX:+HeapDumpOnOutOfMemoryError and -XX:+ExitOnOutOfMemoryError work for OutOfMemoryErrors from filling up the NIO direct memory.<div>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.</div><div><br></div><div><div>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.</div><div><br></div><div>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?</div><div><br clear="all"><div><div dir="ltr"><div dir="ltr">-Man</div></div></div></div></div></div>
</blockquote></div>