[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspectj-users] Class Reloading and Load Time Weaving
- From: "Andy Clement" <andrew.clement@xxxxxxxxx>
- Date: Fri, 16 Nov 2007 17:04:23 +0000
- Delivered-to: firstname.lastname@example.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=NIYWCzw5Lm2V27ZJIHwzOoSAe0U0fJWKXu0uV/4ph20=; b=LJLrn0iHDZnV35P6oto5+Iy+01LTM0enaJ+viVPeZq9mwVNRs4+J/+4V6V4UGwuFskGmeR3JNohVABR66H021zRqH1JyHSW3RFpKcmXc428kGsd3VX2RVxgxhaURLuMaGeaGdZLceBu+LDuxOdr+OkoDbMFYGzKjRYwUyR0ZPDA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=OHR1qdvFwm3vwqeBMjhjx70ISa+YqtjpJmrcSoz7DO/yLkUXVqNAbucT0QQCMZhHFnME5rWRBPO36uK6tp/5eHMVMbJWgNrYR1J+4xIy+kj45N0ZLjlTy1VocCPX1+TA7xomO2ndo+izGCdMRUqei7iH9LP2AyE4j0a31s13TV0=
I thought we had added a method for forcing them to be collected (even
though it shouldnt be needed and if we are holding onto them, it is a
bug) - but on browsing that area of the code, I can't find anything.
If you raise a bug, I will look at it when I get a chance.
On 15/11/2007, Eric Grunzke <eric.grunzke@xxxxxxxxx> wrote:
> I'm working on a project that generates a lot of code and uses a
> custom ClassLoader to pull generated classes into the JVM. My
> structure allows for reloading (by orphaning the old loader and
> creating a new one) in the event that code is regenerated.
> Additionally, I have enabled load-time weaving to add some behavior to
> the generated classes as they are loaded.
> My problem here is that once I enable load-time weaving, orphaned
> class loaders are *not* garbage collected. With some investigation,
> I'm pretty convinced that the Load Time Weaver is holding on to
> references of class loaders that have otherwise been abandoned. As
> long as a reference is maintained to the loader, it will not be
> garbage collected, and all of the classes it loaded will similarly
> stay in memory.
> The bottom line is that this is a memory leak. Classloaders (and
> Classes they load) are never released, so every reload increases
> memory usage, until the VM eventually crashes. Is there a way for me
> to tell AspectJ to release a classloader that is no longer being used?
> Eric Grunzke
> aspectj-users mailing list