-
Notifications
You must be signed in to change notification settings - Fork 50
Memory leak related to org.jboss.threads.JBossThreadFactory #115
Description
We are using jboss-cli-client.jar inside of Jolokia to extract metrics from several JBoss server instances using JMX.
We use Jolokia in proxy mode, it means that we connect to Jolokia using a HTTP/JSON API and Jolokia uses jmx-remoting to obtain the info from the JBoss servers.
After some days running and several thousands queries the Jolokia server runs out of heap memory (java.lang.OutOfMemoryError: GC overhead limit exceeded).
Looking at the different memory spaces, PS Old Gen reaches the max value and did not release.
Analyzing the heap dump with Eclipse MAT: attached image img-2019-03-27-203310.png
One instance of "java.lang.ThreadGroup" loaded by "<system class loader>" occupies 20.846.512 (41,08%) bytes. The instance is referenced by org.jboss.threads.JBossThreadFactory @ 0xe093f8e8 , loaded by "org.jboss.modules.ModuleClassLoader @ 0xe0814138". The memory is accumulated in one instance of "java.lang.ThreadGroup[]" loaded by "<system class loader>".
We were using jboss-threads 2.1.2.Final-redhat-1 (which comes with jboss-cli-client.jar in JBoss EAP 6). After seeing this fix we upgraded jboss-cli-client.jar to use version 2.3.2.Final-redhat-1 (we take that lib from the newer jboss-cli-client.jar of JBoss EAP 7 and put into the JBoss EAP 6 client, maybe that surgery is not really updating the lib used?)
I tried to compile jboss eap 6 from the sources but got a bunch of different errors.
I have also open an issue with Jolokia but as the problem comes from the jboss lib, looks like nothing can be done in that part.
Thanks!
This issue was imported from JIRA. The original issue is JBTHR-72.