Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 95666 invoked from network); 2 Oct 2004 14:11:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Oct 2004 14:11:14 -0000 Received: (qmail 31005 invoked by uid 500); 2 Oct 2004 14:10:58 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 30951 invoked by uid 500); 2 Oct 2004 14:10:57 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 30926 invoked by uid 99); 2 Oct 2004 14:10:57 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 02 Oct 2004 07:10:55 -0700 Received: (qmail 15702 invoked by uid 50); 2 Oct 2004 14:12:49 -0000 Date: 2 Oct 2004 14:12:49 -0000 Message-ID: <20041002141249.15701.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 31510] New: - Memory leaks due to JspWriterImpl keeping reference to ServletResponse after recycle() X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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=31510 Memory leaks due to JspWriterImpl keeping reference to ServletResponse after recycle() Summary: Memory leaks due to JspWriterImpl keeping reference to ServletResponse after recycle() Product: Tomcat 5 Version: 5.0.28 Platform: All OS/Version: All Status: NEW Severity: Normal Priority: Other Component: Jasper AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: ayud@mail.ru This problem causes severe memory leaks in JBoss app server with Jetty servlet container installed (that is using Jasper). I tested it with JBoss 3.2.6RC1 and Jetty 5.0.0. Please see related bug reports: https://sourceforge.net/tracker/? func=detail&aid=973162&group_id=22866&atid=376685 and https://sourceforge.net/tracker/? func=detail&aid=1038066&group_id=7322&atid=107322. In short, after JBoss web application context is destroyed, there is still a hard reference chain (see http://kanika.yi.org/~alexei/jbossleaks/refs-from-jasper5-PageContext-pool-to- UnifiedClassLoader3.html) from Jasper's pool of JspContexts to JBoss' UnifiedClassLoader3. The most logical place to break the chain is, in my opinion, to set org.apache.jasper.runtime.JspWriterImpl.response field to null inside JspWriterImpl.recycle() method. It looks safe, because JspWriterImpl is always initialized with a new response object before use. And it looks logical, because why should a recycled JspWriter keep reference to a response which it will never make use of, being recycled. In my test instalation, adding response = null; to JspWriterImpl.recycle() resolves the problem. --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org