From 1c09148425d15ac3ffe8079838caf27ed74c5f8b Mon Sep 17 00:00:00 2001 From: sershe Date: Tue, 23 Apr 2013 01:48:12 +0000 Subject: [PATCH] HBASE-8384 heap size computation for HStore is fishy git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1470777 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/hadoop/hbase/util/ClassSize.java | 2 -- .../java/org/apache/hadoop/hbase/regionserver/HStore.java | 4 ++-- .../java/org/apache/hadoop/hbase/regionserver/ScanInfo.java | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java index d9fa9a0a077..b3f4d0de972 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/ClassSize.java @@ -242,7 +242,6 @@ public class ClassSize { } if (debug) { if (LOG.isDebugEnabled()) { - // Write out region name as string and its encoded name. LOG.debug("" + index + " " + aField.getName() + " " + aField.getType()); } } @@ -269,7 +268,6 @@ public class ClassSize { long size = align(prealign_size); if(debug) { if (LOG.isDebugEnabled()) { - // Write out region name as string and its encoded name. LOG.debug("Primitives=" + coeff[0] + ", arrays=" + coeff[1] + ", references(includes " + nrOfRefsPerObj + " for object overhead)=" + coeff[2] + ", refSize " + REFERENCE + diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java index 1428a96fae2..fb9e8f4baab 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -1807,8 +1807,8 @@ public class HStore implements Store { } public static final long FIXED_OVERHEAD = - ClassSize.align((17 * ClassSize.REFERENCE) + (5 * Bytes.SIZEOF_LONG) - + (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN); + ClassSize.align(ClassSize.OBJECT + (16 * ClassSize.REFERENCE) + (4 * Bytes.SIZEOF_LONG) + + (2 * Bytes.SIZEOF_INT) + (2 * Bytes.SIZEOF_BOOLEAN)); public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD + ClassSize.OBJECT + ClassSize.REENTRANT_LOCK diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanInfo.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanInfo.java index a7d719aff97..8adc21bf328 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanInfo.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScanInfo.java @@ -39,7 +39,7 @@ public class ScanInfo { public static final long FIXED_OVERHEAD = ClassSize.align(ClassSize.OBJECT + (2 * ClassSize.REFERENCE) + (2 * Bytes.SIZEOF_INT) - + Bytes.SIZEOF_LONG + Bytes.SIZEOF_BOOLEAN); + + (2 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_BOOLEAN); /** * @param family {@link HColumnDescriptor} describing the column family