Package com.gigaspaces.internal.jvm
Class HeapUsageEstimator
java.lang.Object
com.gigaspaces.internal.jvm.HeapUsageEstimator
Based on Java memory spec, and specifically https://github.com/jbellis/jamm/blob/master/src/org/github/jamm/MemoryLayoutSpecification.java
- Since:
- 15.5
- Author:
- Niv Ingberg
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDesc()intintintintstatic voidstatic longroundTo(long x, int multiple) longlongsizeOfArray(Class<?> type, int length) intsizeOfField(Class<?> type) longsizeOfInstance(Class<?> type)
-
Constructor Details
-
HeapUsageEstimator
public HeapUsageEstimator()
-
-
Method Details
-
getDesc
-
getObjectHeaderSize
public int getObjectHeaderSize() -
getObjectPadding
public int getObjectPadding() -
getSuperclassFieldPadding
public int getSuperclassFieldPadding() -
getReferenceSize
public int getReferenceSize() -
sizeOf
- Returns:
- The size of the provided instance as defined by the detected MemoryLayoutSpecification. For an array this is dependent on the size of the array, but for an object this is fixed for all instances
-
sizeOfField
- Returns:
- The memory size of a field of a class of the provided type; for Objects this is the size of the reference only
-
sizeOfInstance
-
sizeOfArray
-
roundTo
public static long roundTo(long x, int multiple) -
main
-