Alex Rudyy created QPID-8384:
--------------------------------

             Summary: [Broker-J] LastValueQueueList can leak deleted queue 
entries
                 Key: QPID-8384
                 URL: https://issues.apache.org/jira/browse/QPID-8384
             Project: Qpid
          Issue Type: Task
          Components: Broker-J
    Affects Versions: qpid-java-broker-7.1.4, qpid-java-broker-7.1.3, 
qpid-java-broker-7.0.8, qpid-java-broker-7.1.2, qpid-java-broker-7.1.1, 
qpid-java-broker-7.0.7, qpid-java-broker-7.0.6, qpid-java-broker-7.0.5, 
qpid-java-broker-7.0.4, qpid-java-broker-7.1.0, qpid-java-6.1.7, 
qpid-java-broker-7.0.1, qpid-java-6.1.5, qpid-java-broker-7.0.0, 
qpid-java-6.1.4, qpid-java-6.0.8, qpid-java-6.1.3, qpid-java-6.0.7, 
qpid-java-6.1.2, qpid-java-6.1.1, qpid-java-6.0.6, qpid-java-6.1, 
qpid-java-6.0.5, qpid-java-6.0.4, qpid-java-6.0.3, qpid-java-6.0.2, 
qpid-java-6.0.1, qpid-java-6.0, 0.32, 0.31, 0.30, 0.29, 0.28, 0.27, 0.26, 0.25, 
0.24, 0.23, 0.22, 0.21, 0.20, 0.19, 0.18, 0.17, qpid-java-6.1.8
            Reporter: Alex Rudyy
             Fix For: qpid-java-broker-7.1.6


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.




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to