简体   繁体   English

内存不足时的Java EE堆转储

[英]Java EE heap dump on Out of Memory

I am using EJB v3.1. 我正在使用EJB v3.1。 Application is running in JBoss. 应用程序正在JBoss中运行。 I'm also using Wildfly. 我也在使用Wildfly。 As I understand all System Exceptions including OutOfMemoryError are wrapped in EJBException. 据我了解,包括OutOfMemoryError在内的所有系统异常都包装在EJBException中。 I set jvm parameters to get heap dump on Out of Memory like this: -XX:+HeapDumpOnOutOfMemoryError but it doesn't work. 我设置了jvm参数,以使堆转储到内存不足,像这样: -XX:+HeapDumpOnOutOfMemoryError但是它不起作用。 I suppose because it is no longer OutOfMemoryError but EJBException. 我想是因为它不再是OutOfMemoryError而是EJBException。
How do I get this working in jave ee? 我如何在jave ee中工作? Also should i get the heap dump when throwing new OutOfMemoryError? 当抛出新的OutOfMemoryError时,我还应该得到堆转储吗?

How do I get this working in jave ee? 我如何在jave ee中工作? Also should i get the heap dump when throwing new OutOfMemoryError? 当抛出新的OutOfMemoryError时,我还应该得到堆转储吗?

If you're using JBoss, you should see the server.log and see if the exception is EJB or OOME, then try to fix it. 如果使用的是JBoss,则应查看server.log并查看异常是EJB还是OOME,然后尝试对其进行修复。

So we have: 因此,我们有:

How do I get this working in jave ee? 我如何在jave ee中工作? See the exception. 看到异常。 Also should i get the heap dump when throwing new OutOfMemoryError? 当抛出新的OutOfMemoryError时,我还应该得到堆转储吗? Yes, if you're correctly using the flag: -XX:+HeapDumpOnOutOfMemoryError 是的,如果您正确使用了以下标志:-XX:+ HeapDumpOnOutOfMemoryError

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

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