Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-5337

Bug in ConcurrentLinkedQueue leads to excessive CPU-consumption by ActiveMQ process

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.9.0, 5.9.1, 5.10.0
    • 5.10.1, 5.11.0
    • Broker
    • None
    • Linux Ubuntu

    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

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            Wawan Wawan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment