Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2372

Memory leak in AbstractJBossMarshaller


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 5.2.0.Beta2
    • 5.2.0.Beta1
    • None

      AbstractJBossMarshaller.marshallerTL is leaking PerThreadInstanceHolder instances. These hold a reference to MarshallingConfiguration, which indirectly holds a reference to the classloader, which of course holds a truckload of stuff.

      The cause of the leak is the fact that noone ever calls remove() on marshallerTL.

      I've tried adding marshallerTL.remove() to AbstractJBossMarshaller.stop(), but this only removed references from JBossAS' MSC Service threads. Other threads (in my case only one thread - "http-/") are still causing the leak.

      Here's the complete path from Thread to ModuleClassLoader:

      classes of org.jboss.modules.ModuleClassLoader
      value of java.util.Hashtable$Entry
      [4] of java.util.Hashtable$Entry[23]
      table of org.infinispan.util.Immutables$ImmutableTypedProperties
      configurationProperties of org.hibernate.search.impl.ImmutableSearchFactory
      delegate of org.hibernate.search.impl.MutableSearchFactory"
      searchFactoryImplementor of org.infinispan.query.CommandInitializer
      value of java.util.HashMap$Entry
      [0] of java.util.HashMap$Entry[4]
      table of java.util.HashMap
      commandInitializers of org.infinispan.util.ModuleProperties
      moduleProperties of org.infinispan.factories.GlobalComponentRegistry
      gcr of org.infinispan.marshall.jboss.ExternalizerTable
      objectTable of org.jboss.marshalling.MarshallingConfiguration
      configuration of org.infinispan.marshall.jboss.AbstractJBossMarshaller$PerThreadInstanceHolder
      value of java.lang.ThreadLocal$ThreadLocalMap$Entry
      [3462] of java.lang.ThreadLocal$ThreadLocalMap$Entry[4096]
      table of java.lang.ThreadLocal$ThreadLocalMap
      threadLocals of java.lang.Thread [Stack Local, Thread]  ""http-/"" native ID: 0x1B18", "28"

            dberinde@redhat.com Dan Berindei (Inactive)
            marko.luksa@gmail.com Marko Luksa (Inactive)
            0 Vote for this issue
            5 Start watching this issue