Qpid
  1. Qpid
  2. QPID-3752

Memory leak in DirectExchange bind/unbind

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 0.8, 0.12
    • Fix Version/s: None
    • Component/s: C++ Broker
    • Labels:
      None
    • Environment:

      RHEL4.7 and RHEL6.2

      Description

      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!

      1. QPID-3752.patch
        1 kB
        Rob Springer

        Issue Links

          Activity

          Rob Springer created issue -
          Hide
          Rob Springer added a comment -

          Sample patch that resolves issue QPID-3752.

          Show
          Rob Springer added a comment - Sample patch that resolves issue QPID-3752 .
          Rob Springer made changes -
          Field Original Value New Value
          Attachment QPID-3752.patch [ 12510376 ]
          Hide
          Rob Springer added a comment -

          Also - apologies if the "Severity" field is incorrect. Between "major" and "minor"...I wasn't sure where this fell.

          Show
          Rob Springer added a comment - Also - apologies if the "Severity" field is incorrect. Between "major" and "minor"...I wasn't sure where this fell.
          Gordon Sim made changes -
          Link This issue duplicates QPID-3403 [ QPID-3403 ]
          Hide
          Gordon Sim added a comment -

          Thanks, Rob. This is actually already fixed on trunk (after the 0.12 release, will be included in 0.14).

          Show
          Gordon Sim added a comment - Thanks, Rob. This is actually already fixed on trunk (after the 0.12 release, will be included in 0.14).
          Gordon Sim made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          32m 44s 1 Gordon Sim 12/Jan/12 15:31

            People

            • Assignee:
              Unassigned
              Reporter:
              Rob Springer
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development