Spring启动应用程序-java.lang.OutOfMemoryError出现问题:超出了GC开销限制
我的SpringBoot应用程序存在Spring启动应用程序-java.lang.OutOfMemoryError出现问题:超出了GC开销限制,java,spring-boot,out-of-memory,Java,Spring Boot,Out Of Memory,我的SpringBoot应用程序存在java.lang.OutOfMemoryError问题:超出了GC开销限制 我可以看到如下日志: Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded. Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: GC o
java.lang.OutOfMemoryError问题:超出了GC开销限制
我可以看到如下日志:
Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded.
Handler dispatch failed; nested exception is
java.lang.OutOfMemoryError: GC overhead limit exceeded.
此外,当我在应用程序中工作时,cpu非常高(99%)。
我认为它与XMX有关。那么,如何检查此应用程序的xmx大小集?还是问题出在其他方面?
提前谢谢
我的SpringBoot应用程序存在java.lang.OutOfMemoryError问题:超出了GC开销限制
我可以看到如下日志:
Handler dispatch failed; nested exception is java.lang.OutOfMemoryError: GC overhead limit exceeded.
Handler dispatch failed; nested exception is
java.lang.OutOfMemoryError: GC overhead limit exceeded.
这是一个常见的错误
这意味着应用程序的JVM在运行垃圾收集器上花费了太多时间。这通常是因为您几乎耗尽了空间,而GC必须越来越频繁地运行才能继续运行
此外,当我在应用程序中工作时,cpu非常高(99%)
这是可以预料的;见上文
我认为它与xmx有关
是的,它与此有关
一种可能性是,您的Web应用程序正在执行的任务需要的内存比-xmx
设置允许的内存更多。增加-xmx
将解决此问题。。。直到你开始一项更大的任务。在这一点上,您需要看看是否可以优化内存使用,或者购买一台内存更多的机器。(你在银行里有多少钱?)
另一种可能是你的webapp内存泄漏。如果这就是问题所在,那么增加-xmx
并不能解决问题。您的Web应用程序可能会再次遇到OOME。。。尽管这可能需要更长的时间
我建议您找到并阅读一篇关于修复内存泄漏的好文章。假设这是一个漏洞。。。直到你找到明确的证据证明不是这样
那么,如何检查此应用程序的xmx大小集
这取决于您如何运行springboot应用程序。例如,本文解释了如何使用嵌入式Tomcat实现这一点