I have a Java application run under this Java version:
openjdk version "1.8.0_162"
OpenJDK Runtime Environment (build 1.8.0_162-8u162-b12-1~deb9u1-b12)
OpenJDK 64-Bit Server VM (build 25.162-b12, mixed mode)
and I have option -XX:+ExitOnOutOfMemoryError specified on the command line. However recently I had OOME scenario where I see OOME in the logs:
java.lang.OutOfMemoryError: unable to create new native thread
, but the application happily continues to work, without exiting. Looks like the option is completely ignored in this scenario. I am not sure what caused the OOME yet, but why could the JVM ignore the exit option? Is there anything that can be done to ensure if OOME happens the application does exit?