I'm having problems with memory leaks, because EJBs are not being removed from the pool. The ejb is 3.0 and stateless.
In my jboss jmx-console 4.3, the statistics of a particular ejb looks like:
AvailableCount 30
MaxSize 30
CurrentSize 5727
CreateCount 5727
RemoveCount 0
My question is: Why the "Remove Count" is not increasing? And the "Current Size" is larger than the "MaxSize"?
Man you have hit a dreaded bug where SLSB are not cleared and leaked... We have faced this issue in Our Production environment a couple of weeks ago...
The only workaround even recommended by JBoss is to use StrictMaxPool
instead of ThreadLocalPool
for your SLSB. Choose the count wisely.
You should modify ejb3-interceptors-aop.xml
<domain name="Stateless Bean">
...
<annotation expr="!class(@org.jboss.annotation.ejb.PoolClass)">
@org.jboss.annotation.ejb.PoolClass (value=org.jboss.ejb3.StrictMaxPool.class, maxSize=30, timeout=10000)
</annotation>
</domain>
Here are some links to give you some insight...
Stateless session bean pooling in JBoss
New instance of resources injected on every onMessage MDB call
ThreadlocalPool does not remove active BeanContext instances from InfinitePool
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With