Details
Description
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