You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2012/07/05 14:53:41 UTC
svn commit: r1357582 -
/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Author: mreutegg
Date: Thu Jul 5 12:53:40 2012
New Revision: 1357582
URL: http://svn.apache.org/viewvc?rev=1357582&view=rev
Log:
JCR-3374: Size estimate for AbstractBundlePersistenceManager.MISSING is too low
Modified:
jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=1357582&r1=1357581&r2=1357582&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java Thu Jul 5 12:53:40 2012
@@ -118,6 +118,14 @@ public abstract class AbstractBundlePers
private static final NodePropBundle MISSING =
new NodePropBundle(NodeId.randomId());
+ /**
+ * The size estimate for the MISSING NodePropBundle. The sum of:
+ * - ConcurrentCache.E: 32 bytes
+ * - LinkedHashMap.Entry: 64 bytes
+ * - NodeId: 32 bytes
+ */
+ private static final long MISSING_SIZE_ESTIMATE = 128;
+
/** the index for namespaces */
private StringIndex nsIndex;
@@ -762,7 +770,7 @@ public abstract class AbstractBundlePers
bundle.markOld();
bundles.put(id, bundle, bundle.getSize());
} else {
- bundles.put(id, MISSING, 16);
+ bundles.put(id, MISSING, MISSING_SIZE_ESTIMATE);
}
return bundle;
}
@@ -776,7 +784,7 @@ public abstract class AbstractBundlePers
private void deleteBundle(NodePropBundle bundle) throws ItemStateException {
destroyBundle(bundle);
bundle.removeAllProperties(getBlobStore());
- bundles.put(bundle.getId(), MISSING, 16);
+ bundles.put(bundle.getId(), MISSING, MISSING_SIZE_ESTIMATE);
}
/**