<small id='7JUud'></small><noframes id='7JUud'>

        <legend id='7JUud'><style id='7JUud'><dir id='7JUud'><q id='7JUud'></q></dir></style></legend>

      1. <i id='7JUud'><tr id='7JUud'><dt id='7JUud'><q id='7JUud'><span id='7JUud'><b id='7JUud'><form id='7JUud'><ins id='7JUud'></ins><ul id='7JUud'></ul><sub id='7JUud'></sub></form><legend id='7JUud'></legend><bdo id='7JUud'><pre id='7JUud'><center id='7JUud'></center></pre></bdo></b><th id='7JUud'></th></span></q></dt></tr></i><div id='7JUud'><tfoot id='7JUud'></tfoot><dl id='7JUud'><fieldset id='7JUud'></fieldset></dl></div>

        <tfoot id='7JUud'></tfoot>
          <bdo id='7JUud'></bdo><ul id='7JUud'></ul>
      2. 即使坏人试图抓住它,我如何在任何 OutOfMemoryException 上使 JVM 退出

        How do I make the JVM exit on ANY OutOfMemoryException even when bad people try to catch it(即使坏人试图抓住它,我如何在任何 OutOfMemoryException 上使 JVM 退出)

        <small id='QzPEa'></small><noframes id='QzPEa'>

      3. <i id='QzPEa'><tr id='QzPEa'><dt id='QzPEa'><q id='QzPEa'><span id='QzPEa'><b id='QzPEa'><form id='QzPEa'><ins id='QzPEa'></ins><ul id='QzPEa'></ul><sub id='QzPEa'></sub></form><legend id='QzPEa'></legend><bdo id='QzPEa'><pre id='QzPEa'><center id='QzPEa'></center></pre></bdo></b><th id='QzPEa'></th></span></q></dt></tr></i><div id='QzPEa'><tfoot id='QzPEa'></tfoot><dl id='QzPEa'><fieldset id='QzPEa'></fieldset></dl></div>
          <tbody id='QzPEa'></tbody>

              • <legend id='QzPEa'><style id='QzPEa'><dir id='QzPEa'><q id='QzPEa'></q></dir></style></legend>

                • <bdo id='QzPEa'></bdo><ul id='QzPEa'></ul>
                  <tfoot id='QzPEa'></tfoot>
                  本文介绍了即使坏人试图抓住它,我如何在任何 OutOfMemoryException 上使 JVM 退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  OOME 属于通常您不应该从中恢复的错误类别.但是如果它被埋在一个线程中,或者有人抓住了它,应用程序就有可能进入一个它没有退出但没有用的状态.即使面对使用可能愚蠢地尝试捕获 Throwable 或 Error/OOME 的库,如何防止这种情况的任何建议?(即您无权直接修改源代码)

                  An OOME is of the class of errors which generally you shouldn't recover from. But if it is buried in a thread, or someone catches it, it is possible for an application to get in a state from which it isn't exiting, but isn't useful. Any suggestions in how to prevent this even in the face of using libraries which may foolishly try to catch Throwable or Error/OOME? (ie you don't have direct access to modify the source code)

                  推荐答案

                  用户 @dennie 发表了应该真的评论成为自己的答案.较新的 JVM 功能使这变得容易,特别是

                  User @dennie posted a comment which should really be its own answer. Newer JVM features make this easy, specifically

                  -XX:+ExitOnOutOfMemoryError
                  

                  在 OOME 上退出,或崩溃:

                  to exit on OOME, or to crash:

                  -XX:+CrashOnOutOfMemoryError
                  

                  自 Java 8u92 https://www.oracle.com/java/technologies/javase/8u92-relnotes.html

                  Since Java 8u92 https://www.oracle.com/java/technologies/javase/8u92-relnotes.html

                  这篇关于即使坏人试图抓住它,我如何在任何 OutOfMemoryException 上使 JVM 退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                    <tbody id='gt5vW'></tbody>

                  <legend id='gt5vW'><style id='gt5vW'><dir id='gt5vW'><q id='gt5vW'></q></dir></style></legend>

                        <bdo id='gt5vW'></bdo><ul id='gt5vW'></ul>
                        <i id='gt5vW'><tr id='gt5vW'><dt id='gt5vW'><q id='gt5vW'><span id='gt5vW'><b id='gt5vW'><form id='gt5vW'><ins id='gt5vW'></ins><ul id='gt5vW'></ul><sub id='gt5vW'></sub></form><legend id='gt5vW'></legend><bdo id='gt5vW'><pre id='gt5vW'><center id='gt5vW'></center></pre></bdo></b><th id='gt5vW'></th></span></q></dt></tr></i><div id='gt5vW'><tfoot id='gt5vW'></tfoot><dl id='gt5vW'><fieldset id='gt5vW'></fieldset></dl></div>

                          • <small id='gt5vW'></small><noframes id='gt5vW'>

                          • <tfoot id='gt5vW'></tfoot>