Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 41020 invoked from network); 23 Jan 2003 23:15:19 -0000 Received: from exchange.sun.com (192.18.33.10) by 208.185.179.12.available.above.net with SMTP; 23 Jan 2003 23:15:19 -0000 Received: (qmail 10032 invoked by uid 97); 23 Jan 2003 23:16:26 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 10016 invoked by uid 97); 23 Jan 2003 23:16:25 -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 10001 invoked by uid 98); 23 Jan 2003 23:16:25 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Thu, 23 Jan 2003 15:14:53 -0800 (PST) From: "Craig R. McClanahan" To: Tomcat Users List Subject: Re: Memory leak with ThreadGroups In-Reply-To: <3E306584.9050301@selectacast.net> Message-ID: <20030123151335.Y59138-100000@icarus.apache.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: localhost 1.6.2 0/1000/N X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N X-Spam-Rating: 208.185.179.12.available.above.net 1.6.2 0/1000/N On Thu, 23 Jan 2003, Joseph Shraibman wrote: > Date: Thu, 23 Jan 2003 16:58:28 -0500 > From: Joseph Shraibman > Reply-To: Tomcat Users List > To: tomcat-user@jakarta.apache.org > Subject: Memory leak with ThreadGroups > > One of my classes creates a static ThreadGroup. I notice that when I > update a class and tomcat reloads that context the ThreadGroup is still > around. If the ThreadGroup is still around that means the old class is > still around, which means that class loader is still around. Why is it > still around? I tried making the ThreadGroup daemon but it didn't help. > > I think the fact that the old class loaders are still around goes a long > way to explaining why tomcat takes up so much memory. > If your application creates new threads (and/or thread groups), then it's *your* problem to cleam them up when the application shuts down, not Tomcat's. Tomcat is only responsible for cleaning up its own threads. A very easy way to deal with this is create a ServletContextListener and clean up all your application threads in the contextDestroyed() method. Craig -- To unsubscribe, e-mail: For additional commands, e-mail: