Details

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.

Andrew Kennedy
added a comment - 30/Mar/10 13:30 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

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.

Andrew Kennedy
added a comment - 01/Apr/10 17:32 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.

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.

Andrew Kennedy
added a comment - 09/Apr/10 09:41 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.