Hi issues with a possible memory leak in ActiveMQ 5.5.0.
I've decided to open a new thread but this relates to my previous problem here: http://activemq.2283324.n4.nabble.com/Transaction-not-started-XA-problems-td3565540.html The issue we are seeing is that ActiveMQ (broker) is holding onto memory as time progresses that does not get released and cannot be GC'ed. Our application uses Spring DMLC. As we have used an external Transaction Manager, the caching has been disabled as default on the DMLC. If we run with this config, then with nothing passing to and fro on the queues, i.e. no activity, ActiveMQ will run out of heap after 2 hours. This is with its heap limited to 90MB to speed things along. Because the caching is disabled in the DMLC, the DMLC is creating a new consumer each time. This can be seen on the advisory topic: ActiveMQ.Advisory.Consumer.Queue.my.queue.1 which continues to increment every couple of seconds. Looking at the debug logs for ActiveMQ, I can see that the consumer is closed and the subscription to the queue is removed. Then a new consumer is added and a new subscription to the queue takes place. A snippet of the logs can be seen below. Why should this occur? Surely there is nothing inherently wrong with creating a new consumer other than it is inefficient. If we enable the Spring DLMC caching the memory problem does not occur. After the problem has occurred if we totally disconnect our applications from ActiveMQ, it is able to reclaim the memory through GC. 2011-06-10 11:48:36,983 | DEBUG | amqtestserver removing consumer: ID:serverName-53567-1307698765827-0:19:2766:1 for destination: queue://my.queue.1 | org.apache.activemq.broker.region.AbstractRegion | ActiveMQ Transport: tcp:///192.168.0.17:53755 2011-06-10 11:48:36,983 | DEBUG | queue://my.queue.1 remove sub: QueueSubscription: consumer=ID:serverName-53567-1307698765827-0:19:2766:1, destinations=1, dispatched=0, delivered=0, pending=0, lastDeliveredSeqId: 0, dequeues: 0, dispatched: 0, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///192.168.0.17:53755 2011-06-10 11:48:36,983 | DEBUG | amqtestserver adding consumer: ID:serverName-53567-1307698765827-0:19:2768:1 for destination: queue://my.queue.1 | org.apache.activemq.broker.region.AbstractRegion | ActiveMQ Transport: tcp:///192.168.0.17:53755 2011-06-10 11:48:36,983 | DEBUG | queue://my.queue.1 add sub: QueueSubscription: consumer=ID:serverName-53567-1307698765827-0:19:2768:1, destinations=0, dispatched=0, delivered=0, pending=0, dequeues: 0, dispatched: 0, inflight: 0 | org.apache.activemq.broker.region.Queue | ActiveMQ Transport: tcp:///192.168.0.17:53755 -- View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-5-5-0-Memory-Leak-Spring-DMLC-tp3588127p3588127.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.