1 Reply Latest reply on Apr 13, 2006 12:17 PM by kabirkhan

    JBAS-3071 - EJB 3.0 memory leaks on redeployment

    clebert.suconic

      I did a quick test on EJB3 this morning, after Kabir had fixed Memory Leaks on HEAD/Branch AOP_MEMORY_LEAK_INVESTIGATION. (He is merging it back BTW).

      Before Kabir fixes I was seeing many more references.


      So, I've found these Strong References:

      Reference 1:

      public abstract class EJBContainer extends ClassContainer implements Container
      {
      ...
       protected ClassLoader classloader; // it could me transformed to WeakReference
      ...
      
      



      Reference 2:

      SimpleStatefulCache has a Thread called timeoutTask, which receives contextClassLoader.

      timeoutTask still being referened, even after its interrupt call.

      It's needed to make sure timeoutTask is really interrupted and the reference should be cleared upon stop.




      Reference 3:

      On EJBContainer again:

      Stateless and StatefulContainer extends EJBContainer
      and:

      public abstract class EJBContainer extends ClassContainer implements Container
      public class ClassContainer extends Advisor
      public abstract class Advisor


      On Advisor there are a bunch of references to Class, and reflection operations on Constructor. We need to clear these references upon undeployment as they are part of AOP API and we can't change them.