Uploaded image for project: 'ActiveMQ .Net'
  1. ActiveMQ .Net
  2. AMQNET-521

LRUCache not working correctly, which can cause Memory Leak and Slowdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 1.7.2, 1.8.0
    • ActiveMQ
    • None
    • Patch Available

    Description

      Reason: Duplicates are not handled correctly. Which causes one of the internal lists (entries) to grow over time until handling the numberous items increases processing overhead and cause a slowdown.

      Background: We are pulling a queue using n consumers with zero prefetch for maximum round robin. (Using Failover-Transport.)
      Processing a message can take time from split a second to several hours. Prefetching a message would not be good. Nether-the-less this is a good way to do it, we discovered increasing memory usage and slowing down of our "workers".

      After a worker processed a task a new call to consumer.Receive(timeout) causes to send a new MessagePull request, which is put into the messageCache using the same id.
      (ProcessMessagePull in ConnectionStateTracker)
      This causes the grow.
      Reason: In LRUCache.this method, the call to entries.Remove uses value and not currentValue.

      Attachments

        1. LRUCache.cs.patch
          2 kB
          Markus Jung

        Activity

          People

            tabish Timothy A. Bish
            markus.jung Markus Jung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: