Cleaning up ActiveMQ object
I am using ActiveMQ as the messaging component in our Java EE application (using GlassFish). We are encountering issues with delay in messages being delivered and with memory leaks. To identify the issue I have started profiling the app. The memory profiling has revealed that the org.apache.activemq.command.ActiveMQObjectMessage is second on the list of 'Live Allocated objects'. The amount of live bytes, live objects and allocated objects is constantly increasing as the app is left running longer.
You would think that the ActiveMQObjectMessage should be cleared down and garbage collected once the message has been published and GC next runs, but this doesnt seem to be the case! Has anyone had similar issue开发者_Python百科s, or can anyone provide any pointers?
Did you make sure received messages are acknowledged? Either use AUTO_ACKNOWLEDGE when creating the session or call #acknowledge() on the received message to do so.
All not acknowledged messages are kept until a single message is ack'd.
What object is holding all of the ActiveMQObjectMessage objects? If you are profiling your app then you should be able to determine this. What profiler are you using? I highly recommend YourKit.
Bruce
精彩评论