You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (JIRA)" <ji...@apache.org> on 2014/08/29 21:55:53 UTC

[jira] [Resolved] (AMQ-5337) Bug in ConcurrentLinkedQueue leads to excessive CPU-consumption by ActiveMQ process

     [ https://issues.apache.org/jira/browse/AMQ-5337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Timothy Bish resolved AMQ-5337.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 5.11.0

In light of the concerns here about OOM issues with the concurrent queue I've switched the code to use a LinkedHashMap and protected access with a R/W lock.  The existing tests show no loss of performance due to this change.  

> Bug in ConcurrentLinkedQueue leads to excessive CPU-consumption by ActiveMQ process
> -----------------------------------------------------------------------------------
>
>                 Key: AMQ-5337
>                 URL: https://issues.apache.org/jira/browse/AMQ-5337
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.9.0, 5.9.1, 5.10.0
>         Environment: Linux Ubuntu
>            Reporter: Wawan
>             Fix For: 5.11.0
>
>
> The AdvisoryBroker use a ConcurrentLinkedQueue to store consumers.
> This standard JDK class has a bug which can lead to an OutOfMemory : https://bugs.openjdk.java.net/browse/JDK-8054446
> In our environment we observe that ActiveMQ process cpu usage is continually climbing and that the ConcurrentLinkedQueue in the AdvisoryBroker grows indefinitely.
> The ConcurrentLinkedQueue is a non-blocking concurrent FIFO datastructure provided by the core Java Development Kit API starting from Java 5. 
> AdvisoryBroker use offer() method to add a new consumer in the ConcurrentLinkedQueue, and remove() method to remove it.
> When the consumer removed is the last element of the queue, the Consumer object is nulled but a node remain in the queue. The null node is then never garbage collected. This is true only for the last element of the queue. Any other element is removed safely.
> Related bug : https://issues.apache.org/jira/browse/AMQ-4853



--
This message was sent by Atlassian JIRA
(v6.2#6252)