You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim Frederic <ji...@isogen.com> on 2003/09/19 00:19:10 UTC
Memory leak in javassist.ClassPool when disable-caching set
version: Tapestry-3.0-beta-2
When org.apache.tapestry.disable-caching is set to true (as a JVM system
property), the HashMap of enhanced classes is cleared at the end of each
request cycle, as it should be. However, the
org.apache.tapestry.enhance.javassist.EnhancedClassFactory holds a
reference to a javassist.ClassPool which keeps growing.
The problem seems to be that with caching disabled, tapestry must
re-enhance a bunch of components on every request. The name of the
enhanced class always ends in $Enhance_n, where n is an incrementing
number. That number is the _uid static int property on
org.apache.tapestry.enhance.ComponentClassFactory.
Suppose I have a tapestry page called myapp.Home. With caching disabled
it is enhanced on each page refresh. The first time the enhanced class
name is myapp.Home$Enhance_0. The second time the enhanced class name
is myapp.Home$Enhance_4 (assuming three other enhanced components on the
page). Thrid time the page is enhanced as myapp.Home$Enhance_8. The
problem is that the javassist.ClassPool holds a Hashtable in which these
class names are keys. Since the "same" class has a different name each
time, the ClassPool grows rapidly. This problem first showed up as
runaway memory growth when running automated UI tests against our
tapestry app.
The proper solution seems to me to be to clear the ClassPool at the same
time the other tapestry pools are cleared.
I searched the mail list for this to no avail. Is this a known issue?
-Jim
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: Memory leak in javassist.ClassPool when disable-caching set
Posted by Mindbridge <mi...@yahoo.com>.
Hi Jim,
This is a good catch, thank you. Please add a bug.
I am experimenting and testing solutions at the moment, I hope I will check
in one soon.
Best regards,
-mb
----- Original Message -----
From: "Jim Frederic" <ji...@isogen.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Friday, September 19, 2003 12:19 AM
Subject: Memory leak in javassist.ClassPool when disable-caching set
> version: Tapestry-3.0-beta-2
>
> When org.apache.tapestry.disable-caching is set to true (as a JVM system
> property), the HashMap of enhanced classes is cleared at the end of each
> request cycle, as it should be. However, the
> org.apache.tapestry.enhance.javassist.EnhancedClassFactory holds a
> reference to a javassist.ClassPool which keeps growing.
>
> The problem seems to be that with caching disabled, tapestry must
> re-enhance a bunch of components on every request. The name of the
> enhanced class always ends in $Enhance_n, where n is an incrementing
> number. That number is the _uid static int property on
> org.apache.tapestry.enhance.ComponentClassFactory.
>
> Suppose I have a tapestry page called myapp.Home. With caching disabled
> it is enhanced on each page refresh. The first time the enhanced class
> name is myapp.Home$Enhance_0. The second time the enhanced class name
> is myapp.Home$Enhance_4 (assuming three other enhanced components on the
> page). Thrid time the page is enhanced as myapp.Home$Enhance_8. The
> problem is that the javassist.ClassPool holds a Hashtable in which these
> class names are keys. Since the "same" class has a different name each
> time, the ClassPool grows rapidly. This problem first showed up as
> runaway memory growth when running automated UI tests against our
> tapestry app.
>
> The proper solution seems to me to be to clear the ClassPool at the same
> time the other tapestry pools are cleared.
>
> I searched the mail list for this to no avail. Is this a known issue?
>
> -Jim
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org