From 006496cf708639db842f37941c40f7d452789509 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 17 Mar 2016 14:47:32 +0000 Subject: Bug 1318180 - HA memory leak in primary broker when overwriting messages in a ring queue ReplicatingSubscription accumulates IDs of dequeued messages to send on dispatch. It should clear the accumulated IDs once sent. Due to a merge error, since: 014f0f3 QPID-4327: HA TX transactions: basic replication. The ID set is not cleared, causing it to accumulate memory slowly. This leak would be particularly noticeable on a busy ring-queue since a ring-queue generates a dequeue event for every enqueue once it reaches its max size. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1735439 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qpid/cpp/src') diff --git a/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp b/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp index fb4cdd014c..8530413b35 100644 --- a/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp +++ b/qpid/cpp/src/qpid/ha/ReplicatingSubscription.cpp @@ -270,10 +270,11 @@ void ReplicatingSubscription::acknowledged(const broker::DeliveryRecord& r) { // Called with lock held. Called in subscription's connection thread. void ReplicatingSubscription::sendDequeueEvent(Mutex::ScopedLock& l) { - ReplicationIdSet oldDequeues = dequeues; if (dequeues.empty()) return; QPID_LOG(trace, logPrefix << "Sending dequeues " << dequeues); - sendEvent(DequeueEvent(dequeues), l); + DequeueEvent d(dequeues); + dequeues.clear(); + sendEvent(d, l); } // Called after the message has been removed -- cgit v1.2.1