| Modifier and Type | Class and Description | 
|---|---|
| private static class  | ClassSize.MemoryLayoutMemoryLayout abstracts details about the JVM object layout. | 
| private static class  | ClassSize.UnsafeLayoutUnsafeLayout uses Unsafe to guesstimate the object-layout related parameters like object header
 sizes and oop sizes
 See HBASE-15950. | 
| Modifier and Type | Field and Description | 
|---|---|
| static int | ARRAYArray overhead | 
| static int | ARRAYLISTOverhead for ArrayList(0) | 
| static int | ATOMIC_BOOLEANOverhead for AtomicBoolean | 
| static int | ATOMIC_INTEGEROverhead for AtomicInteger | 
| static int | ATOMIC_LONGOverhead for AtomicLong | 
| static int | ATOMIC_REFERENCEOverhead for AtomicReference | 
| static int | BYTE_BUFFEROverhead for ByteBuffer | 
| static int | CELL_ARRAY_MAPOverhead for CellArrayMap | 
| static int | CELL_ARRAY_MAP_ENTRYOverhead for Cell Array Entry | 
| static int | CELL_CHUNK_MAPOverhead for CellChunkMap | 
| static int | CELL_CHUNK_MAP_ENTRYOverhead for Cell Chunk Map Entry | 
| static int | CELL_FLAT_MAPOverhead for CellFlatMap | 
| static int | CELL_SETOverhead for CellSkipListSet | 
| static int | CONCURRENT_HASHMAPOverhead for ConcurrentHashMap | 
| static int | CONCURRENT_HASHMAP_ENTRYOverhead for ConcurrentHashMap.Entry | 
| static int | CONCURRENT_HASHMAP_SEGMENTOverhead for ConcurrentHashMap.Segment | 
| static int | CONCURRENT_SKIPLISTMAPOverhead for ConcurrentSkipListMap | 
| static int | CONCURRENT_SKIPLISTMAP_ENTRYOverhead for ConcurrentSkipListMap Entry | 
| static int | COPYONWRITE_ARRAYLISTOverhead for CopyOnWriteArrayList | 
| static int | COPYONWRITE_ARRAYSETOverhead for CopyOnWriteArraySet | 
| static int | INTEGEROverhead for an Integer | 
| static int | LINKEDLISTOverhead for LinkedList(0) | 
| static int | LINKEDLIST_ENTRYOverhead for a single entry in LinkedList | 
| private static org.slf4j.Logger | LOG | 
| static int | MAP_ENTRYOverhead for entry in map | 
| private static ClassSize.MemoryLayout | memoryLayout | 
| static int | NON_SYNC_TIMERANGE_TRACKEROverhead for NonSyncTimeRangeTracker | 
| static int | OBJECTObject overhead is minimum 2 * reference size (8 bytes on 64-bit) | 
| static int | REENTRANT_LOCKOverhead for ReentrantReadWriteLock | 
| static int | REFERENCEReference size is 8 bytes on 64-bit, 4 bytes on 32-bit | 
| static int | STORE_SERVICES | 
| static int | STRINGString overhead | 
| static int | SYNC_TIMERANGE_TRACKEROverhead for SyncTimeRangeTracker | 
| static int | TIMERANGEOverhead for timerange | 
| static int | TREEMAPOverhead for TreeMap | 
| private static boolean | USE_UNSAFE_LAYOUT | 
| Constructor and Description | 
|---|
| ClassSize() | 
| Modifier and Type | Method and Description | 
|---|---|
| static int | align(int num)Aligns a number to 8. | 
| static long | align(long num)Aligns a number to 8. | 
| static long | estimateBase(Class cl,
            boolean debug)Estimate the static space taken up by the fields of a class. | 
| private static long | estimateBaseFromCoefficients(int[] coeff,
                            boolean debug)Estimate the static space taken up by a class instance given the
 coefficients returned by getSizeCoefficients. | 
| private static ClassSize.MemoryLayout | getMemoryLayout() | 
| private static int[] | getSizeCoefficients(Class cl,
                   boolean debug)The estimate of the size of a class instance depends on whether the JVM
 uses 32 or 64 bit addresses, that is it depends on the size of an object
 reference. | 
| static boolean | is32BitJVM()Determines if we are running in a 32-bit JVM. | 
| static long | sizeOf(byte[] b)Calculate the memory consumption (in byte) of a byte array,
 including the array header and the whole backing byte array. | 
| static long | sizeOfByteArray(int len)Calculate the memory consumption (in byte) of a part of a byte array,
 including the array header and the part of the backing byte array. | 
| static boolean | useUnsafeLayout() | 
private static final org.slf4j.Logger LOG
public static final int ARRAY
public static final int ARRAYLIST
public static final int LINKEDLIST
public static final int LINKEDLIST_ENTRY
public static final int BYTE_BUFFER
public static final int INTEGER
public static final int MAP_ENTRY
public static final int OBJECT
public static final int REFERENCE
public static final int STRING
public static final int TREEMAP
public static final int CONCURRENT_HASHMAP
public static final int CONCURRENT_HASHMAP_ENTRY
public static final int CONCURRENT_HASHMAP_SEGMENT
public static final int CONCURRENT_SKIPLISTMAP
public static final int CONCURRENT_SKIPLISTMAP_ENTRY
public static final int CELL_FLAT_MAP
public static final int CELL_CHUNK_MAP
public static final int CELL_CHUNK_MAP_ENTRY
public static final int CELL_ARRAY_MAP
public static final int CELL_ARRAY_MAP_ENTRY
public static final int REENTRANT_LOCK
public static final int ATOMIC_LONG
public static final int ATOMIC_INTEGER
public static final int ATOMIC_BOOLEAN
public static final int ATOMIC_REFERENCE
public static final int COPYONWRITE_ARRAYSET
public static final int COPYONWRITE_ARRAYLIST
public static final int TIMERANGE
public static final int SYNC_TIMERANGE_TRACKER
public static final int NON_SYNC_TIMERANGE_TRACKER
public static final int CELL_SET
public static final int STORE_SERVICES
private static final ClassSize.MemoryLayout memoryLayout
private static final boolean USE_UNSAFE_LAYOUT
public ClassSize()
private static ClassSize.MemoryLayout getMemoryLayout()
public static boolean useUnsafeLayout()
private static int[] getSizeCoefficients(Class cl, boolean debug)
cl - A class whose instance size is to be estimateddebug - debug flagprivate static long estimateBaseFromCoefficients(int[] coeff, boolean debug)
coeff - the coefficientsdebug - debug flagpublic static long estimateBase(Class cl, boolean debug)
cl - classdebug - debug flagpublic static int align(int num)
num - number to align to 8public static long align(long num)
num - number to align to 8public static boolean is32BitJVM()
public static long sizeOf(byte[] b)
sizeOfByteArray(int) instead.b - the byte arraypublic static long sizeOfByteArray(int len)
KeyValue,
 multiple KeyValue objects share a same backing byte array (KeyValue.bytes).
 Also see KeyValue.heapSize().len - the length (in byte) used partially in the backing byte arrayCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.