-
1. Re: Memory & thread leak when application undeployed?
jaikiran Aug 25, 2016 1:58 AM (in response to wdarby)WildFly 10.1.0.Final has been recently released WildFly 10.1 is now available! · WildFly, can you try this against that version and see if you can reproduce it? Can you also attach the complete thread dump here so that one of us can take a look? What kind of components does your application have? JSF, Weld or any such?
-
2. Re: Memory & thread leak when application undeployed?
wdarby Aug 25, 2016 8:53 PM (in response to wdarby)Thanks for the response. I upgraded to 10.1 and see the same behavior. I'm attaching a link the jstack log file. It is for a Wildfly process that has had the application deployed and undeployed 3 times. Note there are 12 "default-threads #", 4 for each deployment (the number increases with each deployment).
Also below is the hprof dump for trace from the threads to the class and static data
Let me know what you think
Thanks
Class Name Shallow Heap Retained Heap 120 9,018,008 - sessionFactory com.leeriver.trading.pjm.data.PjmMarketDaoImpl @ 0xe3c27ff8
24 24 16 40 64 2,560 24 2,584 16 2,600 24 1,352 16 1,368 10,256 76,152 - elementData java.util.Vector @ 0xe38f70a8
32 76,184 88 170,712 8 8 112 2,608 656 7,328 - elementData java.util.Vector @ 0xe38f56e0
32 7,360 88 16,672 - contextClassLoader org.jboss.threads.JBossThread @ 0xe3e2c2d8 default-threads - 7 Thread
136 600 - contextClassLoader org.jboss.threads.JBossThread @ 0xe3e44228 default-threads - 8 Thread
136 600 - contextClassLoader org.jboss.threads.JBossThread @ 0xe3e445a0 default-threads - 5 Thread
136 464 - contextClassLoader org.jboss.threads.JBossThread @ 0xe3e44890 default-threads - 6 Thread
136 600 - Total: 4 entries
- referent java.lang.ref.Finalizer @ 0xe3936a88 »
40 154,944 - Total: 2 entries
-
3. Re: Memory & thread leak when application undeployed?
wdarby Aug 25, 2016 10:17 PM (in response to wdarby)Forgot to mention the configured subsystems:
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
<extension module="org.jboss.as.jdr"/>
<extension module="org.jboss.as.jmx"/>
<extension module="org.jboss.as.logging"/>
<extension module="org.jboss.as.mail"/>
<extension module="org.jboss.as.naming"/>
<extension module="org.jboss.as.pojo"/>
<extension module="org.jboss.as.remoting"/>
<extension module="org.jboss.as.sar"/>
<extension module="org.jboss.as.security"/>
<extension module="org.jboss.as.transactions"/>
<extension module="org.jboss.as.weld"/>
<extension module="org.wildfly.extension.batch.jberet"/>
<extension module="org.wildfly.extension.bean-validation"/>
<extension module="org.wildfly.extension.io"/>
<extension module="org.wildfly.extension.messaging-activemq"/>
<extension module="org.wildfly.extension.request-controller"/>
<extension module="org.wildfly.extension.security.manager"/>
<extension module="org.wildfly.extension.undertow"/>
</extensions>
-
4. Re: Memory & thread leak when application undeployed?
wdarby Aug 29, 2016 2:36 PM (in response to wdarby)After exploring, I learned the "default-threads - #" are part of the JCA subsystem, which is initially configured with max-threads and core-threads of 50. These are used by MDBs if the <resource-adapter-ref> is set to activemq-ra (a pooled-connection factory in messaging-activemq). Since my application starts 4 MDBs, there are 4 instances of default-threads created per deployment.
I modified the configuration for 8 core-threads and 8 max-threads in the JCA <defaul-workmanager>, and for the <pooled-connection-factory> set min-pool-size to 4 and max-pool-size to 8 (it's a relatively small application). Now the threads are reused every other deployment, which releases the classes and corresponding static memory. Not a bug after all, just a configuration issue.