Class ClassSize
- java.lang.Object
-
- org.apache.accumulo.core.file.blockfile.cache.ClassSize
-
public class ClassSize extends Object
Class for determining the "size" of a class, an attempt to calculate the actual bytes that an object of this class will occupy in memory The core of this class is taken from the Derby project
-
-
Field Summary
Fields Modifier and Type Field Description static int
ARRAY
Array overheadstatic int
ARRAYLIST
Overhead for ArrayList(0)static int
ATOMIC_BOOLEAN
Overhead for AtomicBooleanstatic int
ATOMIC_INTEGER
Overhead for AtomicIntegerstatic int
ATOMIC_LONG
Overhead for AtomicLongstatic int
BYTE_BUFFER
Overhead for ByteBufferstatic int
CONCURRENT_HASHMAP
Overhead for ConcurrentHashMapstatic int
CONCURRENT_HASHMAP_ENTRY
Overhead for ConcurrentHashMap.Entrystatic int
CONCURRENT_HASHMAP_SEGMENT
Overhead for ConcurrentHashMap.Segmentstatic int
CONCURRENT_SKIPLISTMAP
Overhead for ConcurrentSkipListMapstatic int
CONCURRENT_SKIPLISTMAP_ENTRY
Overhead for ConcurrentSkipListMap Entrystatic int
COPYONWRITE_ARRAYLIST
Overhead for CopyOnWriteArrayListstatic int
COPYONWRITE_ARRAYSET
Overhead for CopyOnWriteArraySetstatic int
INTEGER
Overhead for an Integerstatic int
MAP_ENTRY
Overhead for entry in mapstatic int
OBJECT
Object overhead is minimum 2 * reference size (8 bytes on 64-bit)static int
REENTRANT_LOCK
Overhead for ReentrantReadWriteLockstatic int
REFERENCE
Reference size is 8 bytes on 64-bit, 4 bytes on 32-bitstatic int
STRING
String overheadstatic int
TREEMAP
Overhead for TreeMap
-
Constructor Summary
Constructors Constructor Description ClassSize()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
align(int num)
Aligns a number to 8.static long
align(long num)
Aligns a number to 8.
-
-
-
Field Detail
-
ARRAY
public static final int ARRAY
Array overhead
-
ARRAYLIST
public static final int ARRAYLIST
Overhead for ArrayList(0)
-
BYTE_BUFFER
public static final int BYTE_BUFFER
Overhead for ByteBuffer
-
INTEGER
public static final int INTEGER
Overhead for an Integer
-
MAP_ENTRY
public static final int MAP_ENTRY
Overhead for entry in map
-
OBJECT
public static final int OBJECT
Object overhead is minimum 2 * reference size (8 bytes on 64-bit)
-
REFERENCE
public static final int REFERENCE
Reference size is 8 bytes on 64-bit, 4 bytes on 32-bit
-
STRING
public static final int STRING
String overhead
-
TREEMAP
public static final int TREEMAP
Overhead for TreeMap
-
CONCURRENT_HASHMAP
public static final int CONCURRENT_HASHMAP
Overhead for ConcurrentHashMap
-
CONCURRENT_HASHMAP_ENTRY
public static final int CONCURRENT_HASHMAP_ENTRY
Overhead for ConcurrentHashMap.Entry
-
CONCURRENT_HASHMAP_SEGMENT
public static final int CONCURRENT_HASHMAP_SEGMENT
Overhead for ConcurrentHashMap.Segment
-
CONCURRENT_SKIPLISTMAP
public static final int CONCURRENT_SKIPLISTMAP
Overhead for ConcurrentSkipListMap
-
CONCURRENT_SKIPLISTMAP_ENTRY
public static final int CONCURRENT_SKIPLISTMAP_ENTRY
Overhead for ConcurrentSkipListMap Entry
-
REENTRANT_LOCK
public static final int REENTRANT_LOCK
Overhead for ReentrantReadWriteLock
-
ATOMIC_LONG
public static final int ATOMIC_LONG
Overhead for AtomicLong
-
ATOMIC_INTEGER
public static final int ATOMIC_INTEGER
Overhead for AtomicInteger
-
ATOMIC_BOOLEAN
public static final int ATOMIC_BOOLEAN
Overhead for AtomicBoolean
-
COPYONWRITE_ARRAYSET
public static final int COPYONWRITE_ARRAYSET
Overhead for CopyOnWriteArraySet
-
COPYONWRITE_ARRAYLIST
public static final int COPYONWRITE_ARRAYLIST
Overhead for CopyOnWriteArrayList
-
-
Method Detail
-
align
public static int align(int num)
Aligns a number to 8.- Parameters:
num
- number to align to 8- Returns:
- smallest number >= input that is a multiple of 8
-
align
public static long align(long num)
Aligns a number to 8.- Parameters:
num
- number to align to 8- Returns:
- smallest number >= input that is a multiple of 8
-
-