Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 14440 invoked from network); 6 Jun 2005 18:17:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2005 18:17:39 -0000 Received: (qmail 62067 invoked by uid 500); 6 Jun 2005 18:17:35 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 62021 invoked by uid 500); 6 Jun 2005 18:17:35 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 61994 invoked by uid 99); 6 Jun 2005 18:17:32 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: 64.14.202.141 is neither permitted nor denied by domain of dain@iq80.com) Received: from Unknown (HELO mgd.gluecode.com) (64.14.202.141) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 06 Jun 2005 11:17:28 -0700 Received: from [192.168.15.100] (68-171-62-46.vnnyca.adelphia.net [68.171.62.46]) (authenticated bits=0) by mgd.gluecode.com (8.12.10/8.12.10) with ESMTP id j56FWuCW017793 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Mon, 6 Jun 2005 08:32:57 -0700 Mime-Version: 1.0 (Apple Message framework v730) In-Reply-To: References: <7DF6BC2D-6B08-42E1-A997-B529B4D1DC66@iq80.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <868F5445-AEB2-4FEB-A0AA-33334FBE9C4C@iq80.com> Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: Memory leaks Date: Mon, 6 Jun 2005 08:33:32 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.730) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I fixed most of the class loader memory leaks. There is still slow leak in cglib which I think will be fixed quickly. For anyone interested in the problem of garbage collecting class loaders, I suggest a wonderful series of articles written by Attila Szegedi (http://www.szegedi.org/). The most helpful for me was the third part (http://www.szegedi.org/articles/memleak3.html) which covers memory leaks in java.io.ObjectStreamClass. This VM bug was causing OutOfMemoryErrors for us when deploying lots of applications. -dain On Jun 4, 2005, at 7:13 PM, Dain Sundstrom wrote: > After poking around the commons logging 1.0.4 code, it looks like I > can explicitly release a class loader from the hashtable, so I'm > going to take a crack at getting our class loaders to GC. > > -dain > > On Jun 4, 2005, at 6:46 PM, Dain Sundstrom wrote: > > >> The other day I started to see OutOfMemory errors, so after a few >> hours of poking around with YourKit, I found the two big leaks. >> >> The first one I found was caused by the GBean reference object >> registering a listener with the lifecycle monitor and never >> unregistering it. Since the reference holds on the the >> GBeanInstance we never could collect a GBeanInstance that had a >> reference (most do). This doesn't mean we were leaking instance >> of the actual service objects, but the GBeanInstance object does >> hold on to a lot of data. >> >> The second leak we have is a leak of class loaders due to the >> following two causes: >> >> 1) Commons logging 1.0.4 >> The LogFactory retains a hard reference to the class loader. I >> believe this has been addressed in the next version which is >> version just in alpha now. >> >> 2) Context class loader of a pooled thread >> We need to clear the context class loader before putting threads >> back in a pool. The context class loader should always be cleared >> after being set in a try/finally block, but in some cases they are >> not. BTW, this is not always a pool, the sun orb keeps a hard >> reference to a thread it uses for reading from a socket. >> >> I don't fix the class loader leak right now (due to commons >> logging), but we should at least start to clear the context when >> reinsert a into a pool. >> >> -dain >> >> >