activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chrajanirao <>
Subject Messages are left in memory with JDBC persistance for queues when no consumers
Date Thu, 20 Aug 2009 20:46:40 GMT


I have noticed that ActiveMQ is keeping the List of Message objects in
memory after persisting them in the DB when there is no consumer on the
queue. What I did is a simple test, I kept on sending persistent messages to
a queue with no active consumers. The broker kept on using more memory and
reached to the max. The heap dump shows that all messages sent to the queue
are also in memory. Why are they being held in memory? Is this normal? If
so, what is the need to have everything in memory even after persisting them
to the DB? I would assume holding a few messages ready to be dispatched when
a consumer comes along makes sense instead of retaining every message that
sent to the queue.

The heap dump shows that the messages are in LinkedHashMap objecy of class. I can
attach the Memory Analyzer screen shots of this heap dump, if you are

I am using ActiveMQ 5.2. Please let me know if this behavior is a bug or if
its expected and why.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message