https://issues.apache.org/bugzilla/show_bug.cgi?id=51395

             Bug #: 51395
           Summary: First application that loads SAXParserFactory causes
                    Class loader memory leak
           Product: Tomcat 7
           Version: 7.0.14
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: arjencornelis.kni...@getronics.com
    Classification: Unclassified


Overview
The class org.apache.catalina.startup.ContextConfig has an array of
org.apache.tomcat.util.digester.Digester objects. Each Digester has a field
factory to refer to a SAXParserFactory. If that SAXParserFactory is loaded via
a WebappClassLoader, that WebappClassLoader is stuck in memory.

Steps to reproduce
Create a Web application that has xercesImpl.jar in its lib. (The Web
application itself doesn't need to use any of the xerces classes.) Upload the
application war file using Tomcat Manager. Verify that the application is
loaded via Tomcat Manager -> List Applications

Restart Tomcat. Via Tomcat Manager -> List Applications, verify that the
application is running. Undeploy the application. Click on Find leaks. The
message above shows the application as leaking.

Make a memory dump using jmap, inspect the memory using jhat.
The WebappClassLoader for this application is still present. Its "reference
chains from rootset" shows a chain like this:
Static reference from org.apache.catalina.startup.ContextConfig.webDigesters
(from class org.apache.catalina.startup.ContextConfig) :
--> [Lorg.apache.tomcat.util.digester.Digester;@0x78be4958 (24 bytes) (Element
0 of [Lorg.apache.tomcat.util.digester.Digester;@0x78be4958:)
--> org.apache.tomcat.util.digester.Digester@0x78be3c50 (101 bytes) (field
factory:)
--> org.apache.xerces.jaxp.SAXParserFactoryImpl@0x78bf0b28 (20 bytes) (??:)
--> class org.apache.xerces.jaxp.SAXParserFactoryImpl (84 bytes) (??:)
--> org.apache.catalina.loader.WebappClassLoader@0x78be3ea0 (165 bytes)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to