qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Bad allocation error
Date Tue, 19 Jan 2010 10:13:33 GMT
On 01/12/2010 08:53 AM, denny86 wrote:
> Gordon Sim wrote:
>> So the crash was happening when you were manually accepting. Was autoAck
>> set to 0 or left as the default value?
> Yes crash occur, when calling messageAccept()
> Left autoAck as default value. Or non-zero. doesn't matter

Just to follow up on this, I've done some testing here (on linux) and I 
believe the memory growth in this case is due to message build up in the 
dispatch queue.

The broker sends messages as fast as it can and in the client these are 
read in by an 'io thread' internal to the client library. The dispatch 
thread then takes these messages and pushes them to listeners. However 
as the Subscription::accept() method is synchronous, this will slow the 
dispatch thread down while the io thread keeps reading in messages and 
queueing them for the dispatcher.

The way to deal with this is to set some flow control. E.g. if you are 
acking every N messages, set a window of N*2 (or similar multiple). That 
prevents the clients memory growing without bounds.

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message