"-XX:OnOutOfMemoryError" does not get excuted

Solution In Progress - Updated -

Issue

We start EAP with JAVA_OPTS="$JAVA_OPTS -XX:OnOutOfMemoryError=\"kill -9 %p\"".
But when an OOM issue occurs, the JBoss process was not killed as expected.

We can see the log below inside JBoss console.log.

java.lang.OutOfMemoryError: Java heap space
Dumping heap to ...
Heap dump file created [4148064575 bytes in 32.996 secs]
#
# java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError="kill -9 %p"
#   Executing /bin/sh -c "kill -9 2829"...

This happens repeatedly.

Environment

Red Hat JBoss Enterprise Application Platform 6.2.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content