Perm or Metaspace OOME due to classloaders persisted by MultiThreadedHttpConnectionManager$ReferenceQueueThreads
Environment
- JBoss Enterprise Application Platform (EAP)
Issue
- We hit an OOME after several redeploys and a heap dump shows application classloaders are persisted by org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThreads.
Resolution
- The application needs to call
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.shutdownAll()upon undeployment to stop those threads and ensure proper clean up. That could be done in an application lifecycle listener as described in Application lifecycle listeners in EAP 6
Root Cause
- The application is starting but not stopping MultiThreadedHttpConnectionManager$ReferenceQueueThreads.
Components
Category
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.