I am using EJB v3.1. Application is running in JBoss. I'm also using Wildfly. As I understand all System Exceptions including OutOfMemoryError are wrapped in EJBException.
I set jvm parameters to get heap dump on Out of Memory like this:
-XX:+HeapDumpOnOutOfMemoryError
but it doesn't work. I suppose because it is no longer OutOfMemoryError but EJBException.
How do I get this working in jave ee?
Also should i get the heap dump when throwing new 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.
So we have:
How do I get this working in jave ee? See the exception. Also should i get the heap dump when throwing new OutOfMemoryError? Yes, if you're correctly using the flag: -XX:+HeapDumpOnOutOfMemoryError