Can OOME reason be provided to -XX:OnOutOfMemoryError script?

Shawn Heisey java at elyograg.org
Tue Oct 15 10:11:57 UTC 2019


Can the OOME reason be provided to the script specified by 
-XX:OnOutOfMemoryError ?

I am a committer on the Apache Lucene-Solr project.  We are using 
-XX:OnOutOfMemoryError in our startup script.  The problem we run into 
is that the OOME exception is frequently NOT logged by our application, 
because it may occur in a part of the program where exceptions are 
swallowed rather than being logged ... and when this happens, we have no 
way of knowing WHY the OOME occured.

Certain options are available on -XX:OnOutOfMemoryError to provide 
useful information to the script, with %p for the PID being the one most 
often used.  I would like the OOME reason (things like "Java heap 
memory" or "unable to create native thread") to be sent to the script as 
well, so we can log it.  Is that currently possible?

I'm aware that this particular mailing list might not be the right place 
for this question ... but I would prefer to limit the number of lists 
that I join.

Thanks,
Shawn


More information about the hotspot-gc-use mailing list