3 Replies Latest reply on Apr 7, 2009 8:16 AM by jaikiran

    stateful session bean is not removed from memory

    alex1234567890

      Hi,

      we are using EJB 3 stateful session beans on JBoss 4.2.2.GA (jems-installer-1.2.1.CR4.jar).
      Our application creates a lot of instances of one stateful bean. About 300 per minute. So we set the timeouts to:

      ... idleTimeoutSeconds=30, removalTimeoutSeconds=30 ...

      At the proper time the "@PreDestroy" method of the bean is called correct.

      If i've a look on the Mbean of this stateful bean all looks fine. Only a few instances of the bean are active, the most beans are removed.

      But in the Java Heap all instances exist and no one was removed. In spite of the Mbean says only 200 instances exist and all othere was removed, after a few hours i see in the heapdump about 400000 instances of this bean (and the same number of instances of type "org.jboss.ejb3.stateful.StatefulBeanContext"). Garbage collection does not remove the bean.

      Is this a problem of the JBoss or why is the bean not evicted from memory?

      Thanks,
      alex