Uploaded image for project: 'Shindig'
  1. Shindig
  2. SHINDIG-1132

ClassLoader memory leak caused by XmlUtil ThreadLocal

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-BETA5
    • Java
    • None
    • When trying to unload the ClassLoader that loaded Shindig, for instance in an OSGi environment

    Description

      The class org.apache.shindig.common.xml.XmlUtil caches a javax.xml.parsers.DocumentBuilder in the ThreadLocal reusableBuilder variable. These instances are created with the static ErrorHandler instance which creates the strong reference to the XmlUtil class that prevents the ClassLoader from being reclaimed.

      Currently the only way to turn off this behaviour is for DocumentBuilder.reset() to throw an exception.

      We need a way to turn off this caching. Maybe the caching aspect could be injected via Guice?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jedws Jed Wesley-Smith
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: