Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
Description
See (CAMEL-4657
In the activemq-pool we have a memory leak when a PooledSession is used to create many consumers. As each consumer is added to an internal list, which in case the session is closed, the list is used to ensure all previously created consumers gets closed as well.
However if the session is used to create many consumers, then that internal list just keep growing, and causing OOME. See attached screenshots of a before vs after with the bug fix.
So to remedy this situation, we should ensure any closed consumer gets removed from that internal list. As its already closed, and therefore the session do not need to keep track of it anymore.
This bug have existed ever since AMQ-615.
The impact of this bug can be seen in CAMEL-4657, which essentially makes using Camel for request/reply over JMS with AMQ and with named replyTo queues (eg not temporary) will cause this problem. The problem manifests due Spring DMLC, which uses a MessageSelector to only pickup expected reply messages. And because the MessageSelector is created once when the consumer is created. We need to create a new Consumer, every time a new message is doing request/reply, to ensure the Message Selector gets updated. So in that situation many consumers get created, which leads to OOME as the list in PooledSession keeps growing.
It would be great if this bug fix can be backported to the 5.5 branch as well.
Attachments
Attachments
Issue Links
- Is contained by
-
AMQ-4370 Potential deadlock between FailoverTransport
- Resolved
- is depended upon by
-
CAMEL-4657 camel-jms - Request/Reply - Leak in ActiveMQSessionPool causing it to eat up memory, when using fixed replyTo queue names
- Resolved