Bug 46549 - Leak caused by org.apache.tomcat.util.digester.Digester not releasing the XMLReader
Summary: Leak caused by org.apache.tomcat.util.digester.Digester not releasing the XML...
Status: RESOLVED DUPLICATE of bug 45933
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Unknown (show other bugs)
Version: 5.5.26
Hardware: PC Windows XP
: P2 normal with 2 votes (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2009-01-16 08:08 UTC by Mauro Molinari
Modified: 2009-04-08 10:20 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Molinari 2009-01-16 08:08:23 UTC
If your webapp comes with Xerces-J (for instance: xercesImpl-2.8.1.jar is in WEB-INF/lib), when org.apache.tomcat.util.digester.Digester.getXMLReader() is executed during webapp start (to read the TLDs) the XMLReader saved into reader field is an instance of class loaded by the webapp class loader (in fact, org.apache.tomcat.util.digester.Digester.getFactory() causes the JDK to find a factory implementation in xercesImpl-2.8.1.jar, which in turn returns a Parser implementation from xercesImpl-2.8.1.jar).

However, when you stop your webapp the reader field of the Digester is not reset, holding a strong reference that prevents the webapp class loader from being garbage collected.

This is something very similar to what is happening in bug #46221.
Comment 1 Mark Thomas 2009-04-08 10:20:50 UTC

*** This bug has been marked as a duplicate of bug 45933 ***