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 |
protected static org.slf4j.Logger |
LOGGER |
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 |
deepSize(Instrumentation instrumentation,
IntPredicate identities,
LongAdder totalSize,
Object object) |
static long |
deepSize(Object object) |
static long |
deepSize(Object object,
IntPredicate identityPredicate) |
static long |
deepSizeWithBloomFilter(Object object,
long expectedObjectCardinality) |
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 |
memoryAsLong(String targetMax) |
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)
Deprecated.
|
static long |
recursiveSize(Object object)
Deprecated.
renamed to deepSize
|
static long |
recursiveSize(Object object,
IntPredicate identityPredicate) |
static long |
recursiveSizeWithBloomFilter(Object object,
long expectedObjectCardinality)
Deprecated.
|
protected static void |
stopDictionarizing(Class<?> clazz,
Field field) |
protected static final org.slf4j.Logger LOGGER
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)
@Deprecated public static long recursiveSize(Object object)
public static long deepSize(Object object)
object - the object to analyzepublic static long recursiveSize(Object object, IntPredicate identityPredicate)
public static long deepSize(Object object, IntPredicate identityPredicate)
@Deprecated public static long recursiveSizeWithBloomFilter(Object object, long expectedObjectCardinality)
public static long deepSizeWithBloomFilter(Object object, long expectedObjectCardinality)
@Deprecated public static void recursiveSize(Instrumentation instrumentation, IntPredicate identities, LongAdder totalSize, Object object)
public static void deepSize(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)
public static long memoryAsLong(String targetMax)
Copyright © 2014–2017 Pivotal Software, Inc.. All rights reserved.