You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2010/11/07 09:27:48 UTC

DO NOT REPLY [Bug 50228] New: PermGen leak when calling JspFragment.invoke() with a custom Writer

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

           Summary: PermGen leak when calling JspFragment.invoke() with a
                    custom Writer
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: knst.kolinko@gmail.com


Created an attachment (id=26266)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26266)
writerleak.war - Reproduces the leak

We have a web application that contains a SimpleTag that calls
JspFragment.invoke(writer) with a custom java.io.Writer (actually, a NullWriter
from commons-io).

When this application is undeployed, it still remains in memory, as reported by
the "Find leaks" tool in the manager webapp.

I am attaching a simple sample application that reproduces the issue.

To reproduce:
1. Deploy the app.
2. Open index.jsp
3. Undeploy the app.
4. "Find leaks" reports that the app is still in memory


Using the Eclipse MAT tool I can see that the leak is caused by
o.a.jasper.runtime.BodyContentImpl keeping a reference to the Writer,
while the BodyContentImpl instance is cached in some pool referenced by a
ThreadLocal.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50228] PermGen leak when calling JspFragment.invoke() with a custom Writer

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50228

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Konstantin Kolinko <kn...@gmail.com> 2010-12-01 20:36:53 EST ---
Fixed in 6.0 with r1041247 (will be in 6.0.30).

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50228] PermGen leak when calling JspFragment.invoke() with a custom Writer

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50228

--- Comment #4 from Konstantin Kolinko <kn...@gmail.com> 2010-11-22 12:45:17 EST ---
Fixed in trunk with r1037794 (will be in 7.0.5), proposed for 6.0.x.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50228] PermGen leak when calling JspFragment.invoke() with a custom Writer

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50228

--- Comment #3 from Konstantin Kolinko <kn...@gmail.com> 2010-11-17 16:01:33 EST ---
I will have to revert r1032232 

It breaks evaluation of tag bodies when there is no writer, e.g.
<c:set var="myvar">value<c:set>
MyVar: [${myvar}]

results in "MyVar: []" being printed.


A working fix would be to nullify the writer only if it has been set
previously. Maybe there is some better way, though.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50228] PermGen leak when calling JspFragment.invoke() with a custom Writer

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50228

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> 2010-11-07 03:30:06 EST ---
Created an attachment (id=26267)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26267)
Screenshot from Eclipse MAT

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 50228] PermGen leak when calling JspFragment.invoke() with a custom Writer

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50228

--- Comment #2 from Konstantin Kolinko <kn...@gmail.com> 2010-11-07 10:21:27 EST ---
Fixed in trunk with r1032232 (will be in 7.0.5), proposed for 6.0.x.

-- 
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org