I am trying to specify the out of memory handler for my Wildfly instance, but it appears that the OutOfMemory exception is being suppressed by the Wildfly runtime, in this case an EJB, prevent the JVM from performing the action. Below is an abbreviated exception stack from an OutOfMemoryError while processing an EJB. It appears this is converted into a javax.ejb.EJBException, logged and dismissed.
Is it possible to allow Out Of Memory exceptions to propagate to the JVM so the OutOfMemory handler is invoked, or is there another option in Wildfly for configuring a similar error handler?
Thanks for any suggestions
2016-08-17 20:11:01,037 ERROR [org.jboss.as.ejb3] (EJB default - 1) WFLYEJB0020:
Error invoking timeout for timer: [id=44cf24e4-ca40-4fa9-8a58-7c4f7e0fe86f time
dObjectId=PjmApp.PjmAccessBean.ejb.PjmAccess auto-timer?:true persistent?:false
timerService=org.jboss.as.ejb3.timerservice.TimerServiceImpl@6dc85ed6 initialExp
iration=null intervalDuration(in milli sec)=0 nextExpiration=Wed Aug 17 20:12:00
UTC 2016 timerState=IN_TIMEOUT info=null]: javax.ejb.EJBException: java.lang.Ru
ntimeException: java.lang.OutOfMemoryError: unable to create new native thread
at org.jboss.as.ejb3.tx.BMTInterceptor.handleException(BMTInterceptor.ja
va:85)
at org.jboss.as.ejb3.tx.EjbBMTInterceptor.checkStatelessDone(EjbBMTInter
ceptor.java:91)
...
Caused by: java.lang.RuntimeException: java.lang.OutOfMemoryError: unable to create new native thread
... 48 more
Caused by: java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:714)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1095)