Memory leak in DirectExchange bind/unbind
-----------------------------------------

                 Key: QPID-3752
                 URL: https://issues.apache.org/jira/browse/QPID-3752
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker
    Affects Versions: 0.12, 0.8
         Environment: RHEL4.7 and RHEL6.2
            Reporter: Rob Springer


One of our customers observed that the Qpid daemon's memory footprint increased 
over a number of weeks. We were able to reproduce this in-house, and noticed 
that the increase was correlated with queu creation/deletion (our application, 
when under load, creates & destroys a large number of queues).

This memory leak wasn't discoverable with valgrind (i.e., memcheck), since it's 
not the result of lost pointers, but massif was very useful. It appears that 
entries in the std::map Bindings (DirectExchange.h:41) created on 
DirectExchange.cpp:71 (during creation of, in our case, the default binding) 
are never deleted when the queue and binding are deleted on 
DirectExchange.cpp:~138.

While individual map entries aren't that expensive, over several thousand queue 
creations and deletions, the memory consumed does grow to be substantial.

If I explicitly delete the map entry, memory usage appears to remain stable 
over time.

While I doubt that my fix will be best way to resolve this issue, I'll attach 
my patch anyway, in the case that it helps in understanding the issue.

Thanks!

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to