activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Broker used up the memory
Date Fri, 29 Sep 2006 15:12:43 GMT
On 9/29/06, HU <gong_pu@hotmail.com> wrote:
>
> Hi, James.
>
> I think I found the guy who eat memory.
>
> On the consumer thread side, it creates a session and a producer for
> replying a message once received a message.

So first of all you should not create a session and producer for every
message...

http://incubator.apache.org/activemq/how-do-i-use-jms-efficiently.html

just use a single session & producer for sending all replies.


> Although I explicitly closed the producer and the session after send the
> respond message, the ActiveMQ seems do not clear the producerID and the
> sessionID from the Object "org.apache.command",

There's no such package or class - do you mean
org.apache.activemq.command? If so thats a package, not a class so
doesn't help too much.

>  so that the memory be used
> slow up by those closed SessionIDs and ProducerIDs with other object
> associates them.
>
> Could you tell me how to release the SessionIDs and ProducerIDs.

I'd like to find out where the objects are being kept. AFAIK the main
place they are rept around is the Connection keeps a collection of
Session objects - which when the session is closed it removes. Could
you find out if the connection is keeping the session objects from
being GC'd?

I just added a try/finally to ActiveMQSession.java so that if the
close of the session fails, it wll definitely still get removed from
teh connection. - maybe that fixes your issue?
-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message