org.github.jamm
Class MemoryMeter
java.lang.Object
org.github.jamm.MemoryMeter
public class MemoryMeter
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoryMeter
public MemoryMeter()
premain
public static void premain(String options,
Instrumentation inst)
isInitialized
public static boolean isInitialized()
withTrackerProvider
public MemoryMeter withTrackerProvider(Callable<Set<Object>> trackerProvider)
- Parameters:
trackerProvider
-
- Returns:
- a MemoryMeter with the given provider
omitSharedBufferOverhead
public MemoryMeter omitSharedBufferOverhead()
- Returns:
- a MemoryMeter that only counts the bytes remaining in a ByteBuffer
in measureDeep, rather than the full size of the backing array.
TODO: handle other types of Buffers
measure
public long measure(Object object)
- Returns:
- the shallow memory usage of @param object
- Throws:
NullPointerException
- if object is null
measureDeep
public long measureDeep(Object object)
- Returns:
- the memory usage of @param object including referenced objects
- Throws:
NullPointerException
- if object is null
countChildren
public long countChildren(Object object)
- Returns:
- the number of child objects referenced by @param object
- Throws:
NullPointerException
- if object is null
Copyright © 2011. All Rights Reserved.