简体   繁体   English

OpenJDK JVM忽略ExitOnOutOfMemoryError

[英]OpenJDK JVM ignores ExitOnOutOfMemoryError

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. 我有一个在此Java版本下运行的Java应用程序: 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)并且在命令行上指定了-XX:+ExitOnOutOfMemoryError选项。 However recently I had OOME scenario where I see OOME in the logs: java.lang.OutOfMemoryError: unable to create new native thread 但是最近我遇到了OOME场景,在该场景中我在日志中看到了OOME: 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? 我不确定是什么导致了OOME,但是JVM为什么可以忽略exit选项? Is there anything that can be done to ensure if OOME happens the application does exit? 有什么措施可以确保OOME发生,但应用程序确实退出了?

Looks like it is a known JVM issue . 看来这是一个已知的JVM问题 Appears not to be fixed yet. 似乎尚未修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM