Hi,
The permgen problem with hibernate was due to a bug in CGLIB, used by
hibernate, which prevented classloaders from being garbage collected and
as such, the permgen memory used allocated during classloading could not
be freed at unload of webapp. This is supposed to be fixed since quite a
good amount of time. Unless you use a very old hibernate version, this
shouldn't be a problem. There are quite regulary bug reports about
memory leaks in hibernate on hibernate tracker, but most are irrelevant,
or fixed in more recent version.

When the webappclassloader does not get garbage collected, it's the
fault of the classes loaded by this classloader. One very common case i
saw is the use of ThreadLocal. ThreadLocal, behind the scene, attaches
the local value to the Thread Object. The locale value references it's
class, which reference it's classloader. The Classloader, even when not
referenced anymore by tomcat, does still get indirectly references by
the HttpThreadPool, preventing garbage collection. Another common way is
to link your object, referencing indirectly your webappclassloader, to
the JNDI and not removing it during unload.

En l'instant précis du 01/06/07 15:09, Torgeir Veimo s'exprimait en ces
termes:
> I seen the problem with permgen errors when one is redeploying a
> webapp that uses hibernate described in a number of places, but I
> haven't seen any solution for it. The Tomcat FAQ even suggest that
> this is a problem with WebAppClassLoaders,
> http://tomcat.apache.org/faq/memory.html#why .
>
> This is an extremely annoying bug,  so I'm wondering, is this
> impossible to fix? Why does tomcat exhibit this problem when Jetty
> does not?
>
>
>
> --Torgeir Veimo
> [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to