Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-7918

[Broker-J] Respond to low heap memory condition by throttling producers.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • Future
    • Broker-J
    • None

    Description

      Currently, if the cumulative size of messages headers/contents cached in direct memory exceeds a threshold, the Java Broker responds by flowing the messages to disk and evicting them from memory. This guards the condition of excessive message payload causing an out-of-memory situation.

      However the Broker also maintains a linked list representing every queues in the JVMs heap memory. Each message is represented by a small node in the linked list. The Broker's design currently means that the entire linked list must reside in (heap) memory (even if the message's content has been paged out by the flow to disk mechanism). This gives rise to the the possibility that the linked lists backing the queue could exhaust all heap and the Broker could fail with an OOM (heap) condition.

      The long term aim is to allow sections linked list to be paged out to eliminate this problem, but this would necessitate a deep redesign.

      As a interim measure, it appears that the the JVM's Memory bean (MemoryPoolMXBean) could be used to notify the Broker when after a garbage collection cycle heap memory usage is above a threshold. The Broker could respond to this event by throttling producer, thus allow consumes to catch up and hopefully avoiding the failure. The Broker would need to relinquish flow control once memory usage had fallen again.

      Consideration would need to be given for different JVMs and different GC implementations. Consideration must also be given for use cases where the Broker is embedded.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kwall Keith Wall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: