activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cybexion <>
Subject Re: Memoryleak when consuming messages from KahaDBStore
Date Fri, 13 Feb 2009 20:02:23 GMT


I just tried something with the Netbeans memory profiler.
My assumption is:
If nothing hass been added to an application then after 2 full runs of the
Garbace Collector the memory should be the same.
In the past we have seen that memory was increasing while messages have been
processed by AMQ. For me that means that something stays in memory even
after those messages have been dequeued.

My test looks like this:
1. start a fresh AMQ instance, send some messages to a queue for
2. do a full GC
3. Take a memory snapshot
4. send exactly 1000 message to the queue
5. consume all 1000 messages from the queue
6. do a full GC
7. Take a another memory snapshot

I would expect that no references to messages do exist any more in the AMQ
JVM because they have all been processed. The memory should look more or
less like it was before the test.
Now I did a memory comparision of my two snapshots. 
The result looks like this: 
>From within the "org.apache.activemq" package there are exactly 1000
MessageKeys, 1000 RemoveMessageCommands and 1000 AdMessageCommands left
Shouldn't those have disappeared because the queue is empty???

Additionaly, if we look at the "org.apache.kaha" package: 
There are 2000 DataByteArrayOutputstreams, 2000 Location objects and 2000
WriteCommands still inside the memory. I would also have expected that those
do not exist after the queue is empty.

Well, personally this does not help me, but maybe one of the developers can
convert this information into a possible bug inside the code?

Help would really be appreciated.



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

View raw message