tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 50460] New: First access to a jspx page causes classloader leak in JspDocumentParser
Date Sun, 12 Dec 2010 02:33:52 GMT

           Summary: First access to a jspx page causes classloader leak in
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper

Running latest 6.0.x,

To reproduce:
1. Stop Tomcat
2. Deploy the examples webapp
3. Create /webapps/examples/foo.jsp file containing the following text:
<jsp:include page="/jsp/jsp2/jspx/basic.jspx"/>

4. Make sure that the work folder of Tomcat is empty.
5. Start Tomcat
6. Go to http://localhost:8080/examples/foo.jsp
7. Go to the Manager web application and stop the examples webapp.
8. Press the "Find leaks" button there.
It is reported that "/examples" causes a leak.
No leaks.

This issue is apparently caused by an instance of
that is being kept in a static final field.

More discussion of such leaks can be found in thread [1] on dev@.


Additional comments:
1) This issue affects the first request that loads the JspDocumentParser class.
Subsequent requests do not cause the issue. Thus only a single webapp is
2) The issue does not happen when there is no webapp code in the call stack.
I.e., it does not happen if the JSPX page was requested directly.
That is why the reproduction recipe uses <jsp:include/>.

Possible solutions:
1) Preload the JspDocumentParser class when Tomcat starts.
2) Do not cache the Exception. Create a new instance each time.
3) Override the fillInStackTrace() method, like it was done in
AbstractDOMParser$Abort in Apache Xerces [2]. I do not know, whether that helps
or not.


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message