tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37793] New: - org.apache.jasper.runtime.BodyContentImpl doesn't reset the 'cb' character array, causes memory leak
Date Mon, 05 Dec 2005 17:37:13 GMT
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=37793>.
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=37793

           Summary: org.apache.jasper.runtime.BodyContentImpl doesn't reset
                    the 'cb' character array, causes memory leak
           Product: Tomcat 5
           Version: 5.5.9
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: pyou@vignette.com
                CC: pyou@vignette.com


In the constructor of BodyContentImpl, member variable 'cb' is initialized via

	cb = new char[bufferSize];

with default buffer size = 512. This character array grows at run time to 
accommodate the body content. In our case, one of our pages produces body 
content over 4 mega characters, resulting the 'cb' array to be expanded to over 
8 mega characters.

The problem is that this huge array never gets reset due to the object pooling 
implementation in Jasper (JspFactoryImpl maintains a pool of PageContextImpl 
objects. Each PageContextImpl object maintains an array of BodyContentImpl 
objects), so the memory it consumed is never returned to the heap.

One suggestion is to reset the 'cb' character array in the setWriter() method.

-- 
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


Mime
View raw message