What memory value of the JConsole increases?
Is that permanent allocation and will not freed until a GC or full GC?
The heap memory usage.
If I perform a GC from Jconsole the memory decreases just a little bit.
Which exact version of JBoss AS are you using?
Jboss 7.1.2 Final with Hq 2.2.16 Final
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.
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.
That doesn't really help. What objects are ever increasing?
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?
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.