public class ApexMemoryHelper extends Object implements IApexMemoryConstants
| Modifier and Type | Field and Description |
|---|---|
static int |
JVM_BYTES_PER_CHAR |
static int |
JVM_MEMORY_CHUNK |
static int |
JVM_STRING_HEADER |
static int |
NB_STRING_BEFORE_CLEAR |
| Modifier | Constructor and Description |
|---|---|
protected |
ApexMemoryHelper() |
| Modifier and Type | Method and Description |
|---|---|
protected static List<Field> |
computeDictionarizableFields(Class<?> clazz) |
static void |
dictionarize(Object data)
This method will replace fields of given object with reference used by other objects.
|
static <T> void |
dictionarizeArray(T[] array) |
protected static void |
dictionarizeFieldValue(Field field,
Object object) |
static void |
dictionarizeIterable(Iterable<?> iterable) |
static long |
getDoubleMemory() |
static long |
getObjectArrayMemory(Object asArray) |
static long |
getObjectArrayMemory(Object[] asArray) |
static long |
getStringMemory(CharSequence existingRef) |
static long |
positivePack(int i1,
int i2)
It might be useful to have an long<->(int,int) packing guaranteeing both integers to be positive if the long is
positive
|
static int |
positiveUnpack1(long packed) |
static int |
positiveUnpack2(long packed) |
static void |
recursiveSize(Instrumentation instrumentation,
IntPredicate identities,
LongAdder totalSize,
Object object) |
static long |
recursiveSize(Object object) |
static long |
recursiveSize(Object object,
IntPredicate identityPredicate) |
static long |
recursiveSizeWithBloomFilter(Object object,
long expectedObjectCardinality) |
protected static void |
stopDictionarizing(Class<?> clazz,
Field field) |
public static final int NB_STRING_BEFORE_CLEAR
public static final int JVM_MEMORY_CHUNK
public static final int JVM_BYTES_PER_CHAR
public static final int JVM_STRING_HEADER
public static void dictionarize(Object data)
data - protected static void dictionarizeFieldValue(Field field, Object object)
field - object - public static long getStringMemory(CharSequence existingRef)
protected static List<Field> computeDictionarizableFields(Class<?> clazz)
public static <T> void dictionarizeArray(T[] array)
public static void dictionarizeIterable(Iterable<?> iterable)
public static long recursiveSize(Object object)
object - the object to analysepublic static long recursiveSize(Object object, IntPredicate identityPredicate)
public static long recursiveSizeWithBloomFilter(Object object, long expectedObjectCardinality)
public static void recursiveSize(Instrumentation instrumentation, IntPredicate identities, LongAdder totalSize, Object object)
instrumentation - an Instrumentation able to provide the memory weight of given objectidentities - an identityHashSet where to collect already handlded objectstotalSize - the LongAdder where to accumulate the memoryobject - the object to analysepublic static long getDoubleMemory()
public static long getObjectArrayMemory(Object[] asArray)
public static long getObjectArrayMemory(Object asArray)
public static final long positivePack(int i1,
int i2)
public static final int positiveUnpack1(long packed)
public static final int positiveUnpack2(long packed)
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.