Heap OutOfMemoryError with JBoss EAP Remoting SASL Authentication Memory Leak
Environment
- Red Hat JBoss Enterprise Application Platform (JBoss EAP) 7.1, 7.2
- Enterprise Java Beans (EJB)
- JBoss Remoting
- Simple Authentication and Security Layer (SASL) Authentication
- OutOfMemoryError (OOME)
Issue
-
Application server fails and exits
-
Error in log:
ERROR [stderr] (Session pool worker) Exception in thread "Session pool worker" java.lang.OutOfMemoryError: Java heap space ERROR [stderr] (default Accept) Exception in thread "default Accept" java.lang.OutOfMemoryError: Java heap space ERROR [org.jboss.mod_cluster.undertow] (UndertowEventHandlerAdapter - 1) Java heap space: java.lang.OutOfMemoryError: Java heap space ERROR [stderr] (default task-28) java.lang.OutOfMemoryError: Java heap space ERROR [stderr] (Thread-4 (ActiveMQ-scheduled-threads)) Exception in thread "Thread-4 (ActiveMQ-scheduled-threads)" java.lang.OutOfMemoryError: Java heap space ERROR [stderr] (default I/O-8) Exception in thread "default I/O-8" java.lang.OutOfMemoryError: Java heap space ERROR [stderr] (Thread-1 (ActiveMQ-scheduled-threads)) Exception in thread "Thread-1 (ActiveMQ-scheduled-threads)" java.lang.OutOfMemoryError: Java heap space Caused by: java.lang.OutOfMemoryError: Java heap space
Resolution
Update to JBoss EAP 7.2 Update 5
Root Cause
There is an issue that can occur is the SASL client creating fails or throws an exception where it will leak the authentication context, resulting in a small, memory leak that will eventually fill the heap space. See Content from issues.jboss.org is not included.REM3-344: ConnectionPeerIdentityContext Doesn't Clean Up authMap Entry if SaslClient is null, Which Leaks Memory
Diagnostic Steps
- Create a heap dump and analyze it. The heap should show one instance of
org.jboss.remoting3._private.IntIndexHashMapthat takes up a considerable amount of memory.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.