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 mr...@apache.org on 2017/07/18 12:18:51 UTC

svn commit: r1802286 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java

Author: mreutegg
Date: Tue Jul 18 12:18:50 2017
New Revision: 1802286

URL: http://svn.apache.org/viewvc?rev=1802286&view=rev
Log:
OAK-6462: Incorrect memory calculation for bundled node states

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java?rev=1802286&r1=1802285&r2=1802286&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeState.java Tue Jul 18 12:18:50 2017
@@ -440,7 +440,7 @@ public class DocumentNodeState extends A
                     // shallow memory:
                     // - 8 bytes per reference in values list
                     // - 48 bytes per string
-                    // double useage per property because of parsed PropertyState
+                    // double usage per property because of parsed PropertyState
                     size += (56 + propState.size(i) * 2) * 2;
                 }
             } else {
@@ -448,7 +448,7 @@ public class DocumentNodeState extends A
                 // referencing the binary in the blob store
                 // double the size because the parsed PropertyState
                 // will have a similarly sized blobId as well
-                size += (long)estimateMemoryUsage(getPropertyAsString(entry.getKey())) * 2;
+                size += (long)estimateMemoryUsage(asString(entry.getValue())) * 2;
             }
         }
         if (size > Integer.MAX_VALUE) {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java?rev=1802286&r1=1802285&r2=1802286&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/DocumentBundlingTest.java Tue Jul 18 12:18:50 2017
@@ -61,7 +61,6 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.spi.state.NodeStateUtils;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Rule;
 import org.junit.Test;
 
@@ -187,7 +186,6 @@ public class DocumentBundlingTest {
         assertThat(bundledMem, is(greaterThan(nonBundledMem)));
     }
 
-    @Ignore("OAK-6462")
     @Test
     public void memoryWithBinary() throws Exception {
         Blob blob = store.createBlob(new RandomStream(1024, 17));