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 2008/02/09 00:30:41 UTC

DO NOT REPLY [Bug 44383] New: - Possible leak: tomcat does not release Jasper compilation contexts

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44383

           Summary: Possible leak: tomcat does not release Jasper
                    compilation contexts
           Product: Tomcat 5
           Version: 5.5.25
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: diosnoes@hotmail.com


First of all, my excuses is this happens not to be an actual bug. And excuses
for my language too, as I am not a native english speaker.

I have found that the live heap size of one of my developed web applications
varies a lot after the JSPs have been compiled on Tomcat 5.5.25 compared with
using precompiled pages. I mean, if I restart Tomcat without deleting "work" and
request the same pages, the live heap is a lot smaller.

Using jhat on a dump of live objects after the compilation, I have found a LOT
of live instances of classes contained in the package org.apache.jasper.compiler:

44902 instances of class org.apache.jasper.compiler.Mark
27437 instances of class org.apache.jasper.compiler.Node$TemplateText
27342 instances of class org.apache.jasper.compiler.ELNode$ELText
18206 instances of class org.apache.jasper.compiler.Node$Nodes
16780 instances of class org.apache.jasper.compiler.ELNode$Nodes
13080 instances of class org.apache.jasper.compiler.Node$JspAttribute
11040 instances of class javax.servlet.jsp.tagext.TagData

After inspection of the references, I believe that the majority of those
instances are being indirectly referenced from instances of:

org.apache.jasper.compiler.JspRuntimeContext
org.apache.jasper.JspCompilationContext

The live heap of Tomcat + Application with precompiled pages show no instances
of those classes (the first ones), so those instances must be related to JSP
compilation-time and not to the runtime.

Maybe Tomcat is not releasing some this compilation-time information of Jasper?

I do not know the internals of Tomcat and Jasper integration, and I think this
could be a major source of resource consumption. I cannot believe being the
first to notice such a thing, and maybe it is the expected behaviour after all...

Thanks a lot for your attention.

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

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


DO NOT REPLY [Bug 44383] - Possible leak: tomcat does not release Jasper compilation contexts

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44383





------- Additional Comments From diosnoes@hotmail.com  2008-02-08 15:35 -------
I forgot to mention that I have disabled tag pooling in the web.xml.


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

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


DO NOT REPLY [Bug 44383] - Possible leak: tomcat does not release Jasper compilation contexts

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44383





------- Additional Comments From diosnoes@hotmail.com  2008-02-10 13:38 -------
I think I understand the issue now. If the JspServlet (Jasper) is in development
mode (the default) the compiler (JDTCompiler) keeps the Node information of the
page after the compilation to provide the source line in case of an error.

On our production server, this mode of operation more than doubles the needed
memory to run the applications.

I think this should be clarified in the documentation as it only relates the
option "development" to the behaviour with respect to modifications and not to
the extra memory cost of this information.

Thanks Mark for your response.

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

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


DO NOT REPLY [Bug 44383] - Possible leak: tomcat does not release Jasper compilation contexts

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44383


markt@apache.org changed:

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




------- Additional Comments From markt@apache.org  2008-02-09 10:09 -------
Lots of objects does not mean you have a memory leak. I have checked compilation
and execution for jsps and tags with and without re-loads and can't find any
memory leaks.

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

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


DO NOT REPLY [Bug 44383] - Possible leak: tomcat does not release Jasper compilation contexts

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44383>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44383





------- Additional Comments From diosnoes@hotmail.com  2008-02-09 18:46 -------
Maybe it is not a leak in the sense of unlimited growth because they are -maybe-
unreferenced -and substituted- in the next compilation of the JSP (I don't
know). Let's say it could be a big bunch of unneeded objects.

Do you mean that you have not found the class of objects I mention? If not, I
understand that I must provide a verifiable test case. But if you have found
those objects, do you think it is ok, provided they are only needed to compile
JSPs??

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

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