Qpid
  1. Qpid
  2. QPID-2466

Replace WeakReference use with SoftReference for enhanced message caching

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: Java Broker
    • Labels:
    • Environment:

      JVM 1.6.0_18

      Description

      Replace use of WeakReference with SoftReference in the message handles in the broker to improve message cache performance when using a persistent store. Also tuning the eviction policy for soft references and evaluation of other GC settings.

        Activity

        Hide
        Andrew Kennedy added a comment -

        Patch is for branch, and requires the following commands to be run afterwards to move the files correctly with subversion:

        $ mv qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SoftReferenceMessageHandle.java qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java
        $ svn mv qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SoftReferenceMessageHandle.java

        Show
        Andrew Kennedy added a comment - Patch is for branch, and requires the following commands to be run afterwards to move the files correctly with subversion: $ mv qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SoftReferenceMessageHandle.java qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java $ svn mv qpid/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SoftReferenceMessageHandle.java
        Hide
        Robbie Gemmell added a comment -

        Changes commited 0.5.x-dev branch only for now.

        Patch still to be added to trunk.

        Show
        Robbie Gemmell added a comment - Changes commited 0.5.x-dev branch only for now. Patch still to be added to trunk.
        Hide
        Andrew Kennedy added a comment -

        Trunk patch. No performance testing performed with these changes.

        Show
        Andrew Kennedy added a comment - Trunk patch. No performance testing performed with these changes.
        Hide
        Andrew Kennedy added a comment -

        The -XX:SoftRefLRUPolicyMSPerMB=<value> option controls how old soft references must be before they are freed by the GC, measured in milliseconds per MB of free space available. The default is 1000 and tests indicate this is too large and will result in softly reachable (ie, evictable) cache objects filling up the heap and causing out of memory errors. Suggested values for this option are 1 or 10.

        Show
        Andrew Kennedy added a comment - The -XX:SoftRefLRUPolicyMSPerMB=<value> option controls how old soft references must be before they are freed by the GC, measured in milliseconds per MB of free space available. The default is 1000 and tests indicate this is too large and will result in softly reachable (ie, evictable) cache objects filling up the heap and causing out of memory errors. Suggested values for this option are 1 or 10.
        Hide
        Andrew Kennedy added a comment -

        Based on test reults with the SoftReferenceMessageHandles it was determined that the LRU setting at the default value provides adequate performance, and that changing this for all installations is inadvisable. Tuning of this option should be carried out on a per-JVM version basis, and would usually only correspond to the a particulat workload being handled by the broker.

        Show
        Andrew Kennedy added a comment - Based on test reults with the SoftReferenceMessageHandles it was determined that the LRU setting at the default value provides adequate performance, and that changing this for all installations is inadvisable. Tuning of this option should be carried out on a per-JVM version basis, and would usually only correspond to the a particulat workload being handled by the broker.
        Hide
        Robbie Gemmell added a comment -

        Review OK.

        Show
        Robbie Gemmell added a comment - Review OK.

          People

          • Assignee:
            Robbie Gemmell
            Reporter:
            Andrew Kennedy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development