-
1. Re: Memory leak when calling injected stateless beans from MDB
wdfink Apr 25, 2013 9:17 AM (in response to crytek)What memory value of the JConsole increases?
Is that permanent allocation and will not freed until a GC or full GC?
-
2. Re: Memory leak when calling injected stateless beans from MDB
crytek Apr 25, 2013 10:27 AM (in response to wdfink)The heap memory usage.
If I perform a GC from Jconsole the memory decreases just a little bit.
-
3. Re: Memory leak when calling injected stateless beans from MDB
jaikiran Apr 25, 2013 10:07 PM (in response to crytek)Which exact version of JBoss AS are you using?
-
4. Re: Memory leak when calling injected stateless beans from MDB
crytek Apr 26, 2013 2:17 AM (in response to jaikiran)Jboss 7.1.2 Final with Hq 2.2.16 Final
-
5. Re: Memory leak when calling injected stateless beans from MDB
jaikiran Apr 26, 2013 5:50 AM (in response to crytek)I am not really sure how you are inferring a memory leak. How many bean instances do you see? Why do you think there's a memory leak? Remember, stateless EJB instances are pooled so once created, they can stay in memory.
-
6. Re: Memory leak when calling injected stateless beans from MDB
crytek Apr 26, 2013 8:27 AM (in response to jaikiran)I know, EJB instances stay inside a fixed size pool. Maybe this pic will help my point of view. Remember that messages do not gather on the queues. They are consumed faster than they are sent. Same test for MDBs with empty onMessage() method shows a stable heap memory usage. You can also see that if the EJB is lookup via JNDI the memory is also stable.
However, for MDBs which call inside their onMessage() method the method of an EJB injected via DI, the heap memory usage increases constantly. The called EJB method is only incrementing a counter, nothing more. Continuing sending messages in this case, the heap memory becomes full and the server simply crashes.
First node of the cluster lookup for EJB inside the @PostConstruct method via JNDI
Second cluster node directly injects the EJB via DI on its initialisation.
The EJB is deployed on the second cluster node.
The EJB called method is incrementing a long type variable.
-
7. Re: Memory leak when calling injected stateless beans from MDB
jaikiran Apr 26, 2013 8:24 AM (in response to crytek)That doesn't really help. What objects are ever increasing?
-
8. Re: Memory leak when calling injected stateless beans from MDB
jaikiran Apr 26, 2013 8:29 AM (in response to crytek)Florin Slev wrote:
Continuing sending messages in this case, the heap memory becomes full and the server simply crashes.
I haven't yet heard of a case where this has been reported and this is a pretty basic case. Do you have an application which you can attach to reproduce this crash?
-
9. Re: Memory leak when calling injected stateless beans from MDB
crytek Apr 26, 2013 9:38 AM (in response to jaikiran)I didn'tget the chance to make a heap dump in this case. Don't know which kind of objects were there.
However I made in a similar case a heap dump and the biggest no of loaded objects were HornetQ related objects.
I've attached a sample of my test project.