You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/02/04 11:09:01 UTC

svn commit: r1564238 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java

Author: thomasm
Date: Tue Feb  4 10:09:01 2014
New Revision: 1564238

URL: http://svn.apache.org/r1564238
Log:
OAK-1383 Reduce memory usage of the cache

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java?rev=1564238&r1=1564237&r2=1564238&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java Tue Feb  4 10:09:01 2014
@@ -677,11 +677,18 @@ public class DocumentMK implements Micro
         
         public <K extends CacheValue, V extends CacheValue> Cache<K, V> buildCache(long maxWeight) {
             if (LIRS_CACHE) {
-                return CacheLIRS.newBuilder().weigher(weigher).
-                        maximumWeight(maxWeight).recordStats().build();
+                return CacheLIRS.newBuilder().
+                        weigher(weigher).
+                        averageWeight(2000).
+                        maximumWeight(maxWeight).
+                        recordStats().
+                        build();
             }
-            return CacheBuilder.newBuilder().weigher(weigher).
-                    maximumWeight(maxWeight).recordStats().build();
+            return CacheBuilder.newBuilder().
+                    weigher(weigher).
+                    maximumWeight(maxWeight).
+                    recordStats().
+                    build();
         }
     }