Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 44715 invoked from network); 3 Jan 2003 09:33:40 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 3 Jan 2003 09:33:40 -0000 Received: (qmail 29118 invoked by uid 97); 3 Jan 2003 09:34:49 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 29102 invoked by uid 97); 3 Jan 2003 09:34:49 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 29090 invoked by uid 98); 3 Jan 2003 09:34:48 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.0 Beta Date: Fri, 03 Jan 2003 02:33:17 -0700 From: "Saurabh Arora" To: Subject: RE: Memory Usage and Garbage Collection Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Just wanted to know, does the current implementation of tomcat 4.1.18 also has the same problem of keeping the jsp's in memory. or it was only present in 4.0.4 saurabh >>> andpro77@gmx.net 01/03/03 02:26PM >>> Hi Craig, please see intermixed. On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote: > > Instances can be garbage collected IF AND ONLY IF there are no > live references to that object in a static/instance/local > variable of some other object that is also in memory. Only > instances that are no longer referenced from other object > instances can be recycled. Please consider the following service() or doGet() or so of a servlet: public void service(ServletRequest request, ServletResponse response) throws IOException { OtherObject otherObject = new OtherObject(); otherObject.doThisAndThat(request, response); } Do I have to place the following otherObject = null; before the end of service(). Doesn't otherObject be gc-ed otherwise? I've never done this. What about the object instances, which otherObject.doThisAndThat() creates? So far I've thought there are no live references if otherObject gets gc-ed. > > In the case at hand, Tomcat (obviously) has references to all the > servlets that it has loaded. Therefore, those servlet instances > cannot be garbage collected. Furthermore, any object that is > referenced by static or instance variables of your servlet class > can *also* not be garbage collected, because live references > still exist. Same thing for session attributes. OK, this is obvious. Andreas deleted the latter parts... -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: