0 Replies Latest reply on Dec 16, 2015 5:01 AM by folch

    Tomcat shutdown Thread leaks detected

    folch

      Hi,

       

      I'm deploying Modeshape 4.4.0 which is using Infinispan 7.2.3 in TomEE(1.6 and 1.7).

      It works without any issue (with high concurrency), however when I try to shutdown my webapp, which is properly shuting down Modeshape and Infinispan, I see a lot of the following logs in Catalina log:

       

      Oct 30, 2015 1:00:30 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

      SEVERE: The web application [/hes] created a ThreadLocal with key of type [org.jboss.marshalling.UTFUtils.BytesHolder] (value [org.jboss.marshalling.UTFUtils$BytesHolder@5e166dae]) and a value of type [byte[]] (value [[B@127aeac4]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

       

      Oct 30, 2015 1:00:30 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

      SEVERE: The web application [/hes] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@43caf356]) and a value of type [org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8.CounterHashCode] (value [org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8$CounterHashCode@412db5df]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

       

      Oct 30, 2015 1:00:30 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

      SEVERE: The web application [/hes] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@1fff64e7]) and a value of type [org.infinispan.commons.util.concurrent.jdk8backported.EquivalentConcurrentHashMapV8.CounterHashCode] (value [org.infinispan.commons.util.concurrent.jdk8backported.EquivalentConcurrentHashMapV8$CounterHashCode@38398a1a]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

       

      Oct 30, 2015 1:00:30 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

      SEVERE: The web application [/hes] created a ThreadLocal with key of type [org.modeshape.jcr.NodeTypes$1] (value [org.modeshape.jcr.NodeTypes$1@4999cdcc]) and a value of type [org.modeshape.jcr.NodeTypes.SingleNodeDefinitionSet] (value [org.modeshape.jcr.NodeTypes$SingleNodeDefinitionSet@23df1f34]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

       

      Searching in Infinispan Issue Track System, I've found this one: [ISPN-2786] ThreadLocal memory leak in Tomcat - JBoss Issue Tracker

      The bug is marked as fixed in 5.3.0.Final, however I still can see the same error in Infinispan 7.2.3.

       

      Do you have any idea about what can we do to avoid this problem? In Linux, this warning prevents Tomcat to be restarted and we should kill the process.

      I've attached my infinispan_config.xml.

       

      Thanks in advance