activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frugia, Kirby A" <kirby.fru...@hp.com>
Subject RE: Broker not releasing memory
Date Wed, 03 Dec 2008 15:28:20 GMT
I'm not sure if it would be the prefetch size.  The memory usage rightly goes up when the consumer
stops ack'ing messages.  The question is, why does it never go back down when the consumer
disconnects?

Also, I think changing the message cursor strategy would only prolong the time between failures.
 Yes, we could start caching messages to disk, but I would like to know why the messages don't
get cleaned up from memory when the consumers disconnect (cleanly or not).

-Kirby

-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
Sent: Tuesday, December 02, 2008 7:52 AM
To: users@activemq.apache.org
Subject: Re: Broker not releasing memory

On Mon, Nov 24, 2008 at 7:37 AM, Frugia, Kirby A <kirby.frugia@hp.com> wrote:
> Hi All,
>
> Sorry I dual-posted in the dev list.  I think I sent to the wrong one...
>
> We are seeing an issue with our broker not releasing memory on topics.
>
> Setup:
> * Active MQ 5.1 (out of the box)
> * Persistent messages sent by publishers
> * Non-durable topics
>
> We were seeing an issue in production with slow consumers causing the broker to run out
of memory.
>
> We wrote a test app, which has one publisher and one subscriber to the same topic.  The
publisher sends messages on this topic frequently.  The subscriber, upon receiving a message,
goes to sleep for 10 minutes.
>
> Very quickly, the broker runs out of memory.  When this happens, our publishers can no
longer send messages; the send is blocked. This is expected.  However, if we kill our application
(which cleanly disconnects from the broker), the broker's memory usage (MemoryPercentUsage)
does not go back down.  Also, any new apps that startup will have their publishers blocked.
>
> Shouldn't the broker release the memory associated with these messages?

The first thing to do is configure the prefetch buffer for the client?:

http://activemq.apache.org/what-is-the-prefetch-limit-for.html

See how that affects the situation. If you're still experiencing
issues, you might need to consider using a different message cursor
strategy:

http://activemq.apache.org/message-cursors.html

Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/

Mime
View raw message