public class MemoryMeter
extends java.lang.Object
构造器和说明 |
---|
MemoryMeter() |
限定符和类型 | 方法和说明 |
---|---|
static MemoryMeter |
build()
获取一个内存测量实例
|
long |
countChildren(java.lang.Object object) |
MemoryMeter |
enableDebug()
Makes this
MemoryMeter prints the classes tree to System.out when measuring |
MemoryMeter |
enableDebug(int depth)
Makes this
MemoryMeter prints the classes tree to System.out up to the specified depth
when measuring |
static boolean |
hasInstrumentation() |
MemoryMeter |
ignoreKnownSingletons()
return a MemoryMeter that ignores space occupied by known singletons such as Class objects and Enums
|
MemoryMeter |
ignoreNonStrongReferences()
return a MemoryMeter that ignores space occupied by known singletons such as Class objects and Enums
|
MemoryMeter |
ignoreOuterClassReference() |
long |
measure(java.lang.Object object) |
long |
measureDeep(java.lang.Object object) |
MemoryMeter |
omitSharedBufferOverhead() |
MemoryMeter |
withGuessing(GuessPolicy guess) |
MemoryMeter |
withTrackerProvider(java.util.concurrent.Callable<java.util.Set<java.lang.Object>> trackerProvider) |
public static boolean hasInstrumentation()
public static MemoryMeter build()
public MemoryMeter withTrackerProvider(java.util.concurrent.Callable<java.util.Set<java.lang.Object>> trackerProvider)
trackerProvider
- public MemoryMeter omitSharedBufferOverhead()
public MemoryMeter withGuessing(GuessPolicy guess)
public MemoryMeter ignoreOuterClassReference()
public MemoryMeter ignoreKnownSingletons()
public MemoryMeter ignoreNonStrongReferences()
public MemoryMeter enableDebug()
MemoryMeter
prints the classes tree to System.out
when measuringpublic MemoryMeter enableDebug(int depth)
MemoryMeter
prints the classes tree to System.out
up to the specified depth
when measuringdepth
- the maximum depth for which the class tree must be printedpublic long measure(java.lang.Object object)
java.lang.NullPointerException
- if object is nullpublic long measureDeep(java.lang.Object object)
java.lang.NullPointerException
- if object is nullpublic long countChildren(java.lang.Object object)
java.lang.NullPointerException
- if object is null