Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-8433

[Broker-J][7.0.x] LastValueQueueList can leak deleted queue entries



    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, qpid-java-6.0, qpid-java-6.0.1, qpid-java-6.0.2, qpid-java-6.0.3, qpid-java-6.0.4, qpid-java-6.0.5, qpid-java-6.1, qpid-java-6.0.6, qpid-java-6.1.1, qpid-java-6.1.2, qpid-java-6.0.7, qpid-java-6.1.3, qpid-java-6.0.8, qpid-java-6.1.4, qpid-java-broker-7.0.0, qpid-java-6.1.5, qpid-java-broker-7.0.1, qpid-java-6.1.7, qpid-java-broker-7.1.0, qpid-java-broker-7.0.4, qpid-java-broker-7.0.5, qpid-java-broker-7.0.6, qpid-java-broker-7.0.7, qpid-java-broker-7.1.1, qpid-java-broker-7.1.2, qpid-java-broker-7.0.8, qpid-java-broker-7.1.3, qpid-java-broker-7.1.4
    • Fix Version/s: qpid-java-broker-7.0.9
    • Component/s: Broker-J
    • Labels:


      Qpid Broker-j can run out of heap memory due to leaking deleted LVQ  entries via LastValueQueueList#_latestValuesMap.

      The deleted queue entry can be left in LastValueQueueList#_latestValuesMap in result of race between enqueing thread and consuming or management thread, where entry is deleted. An LVQ entry is removed from LastValueQueueList#_latestValuesMap, when _latestValueReference is set on the entry as part of invocation LastValueQueueList#add(...). If _latestValueReference is not set in result of unfortunate thread scheduling, the LVQ entry might not be removed from the LastValueQueueList#_latestValuesMap as part of invocation of LastValueQueueList$ConflationQueueEntry#onDelete.

      In some unlucky circumstances the deleted entry can hold a reference to another deleted entry. They can makes a chain of deleted entries, which is referenced from LastValueQueueList#_latestValuesMap. The latter prevents the Garbage Collector from freeing the memory occupied by the chain of deleted entries.

      The solution for this problem seems require adding into LastValueQueueList#add(...) after setting of LastValueQueueList$ConflationQueueEntry#_latestValueReference a call to LastValueQueueList$ConflationQueueEntry#onDelete, when the entry state is DELETED.

      The reason why deleted LVQ entries remained linked together is not clear yet.


          Issue Links



              • Assignee:
                orudyy Alex Rudyy
                orudyy Alex Rudyy
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: