users@glassfish.java.net

Re: Classloader Leaking

From: <glassfish_at_javadesktop.org>
Date: Fri, 05 Feb 2010 05:57:21 PST

I've tried that already. My Stateless Session Bean has only one field which is an injtected instance of EntityManager. I added a @PReDestroy method to set it to null, but debugging while undeploying, I realized that it was null already.

One thing I came across is that if your hibernate entities contains enums (@Enumerated) then all of them get stuck in memory. If you remove all the enums from there, then they get collected after undeployment. Unfortunatelly, SLSB, proxies and $__javassist__$, are never removed. They stay in the current ClassLoader with no instance associated.
[Message sent by forum member 'mmilanez' (mmilanez_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=384990