public final class TreePrinter extends Object implements MemoryMeterListener
System.out the class tree with the size information.| Modifier and Type | Class and Description |
|---|---|
static class |
TreePrinter.Factory
Factory for
TreePrinter instances. |
| Constructor and Description |
|---|
TreePrinter(int maxDepth) |
| Modifier and Type | Method and Description |
|---|---|
void |
arrayElementAdded(Object[] array,
int index,
Object elementValue)
Notification that the element from the specified array has been added.
|
void |
byteBufferRemainingMeasured(ByteBuffer buffer,
long size)
Notification that the size of the remaining bytes of a
ByteBuffer have been measured. |
void |
done(long size)
Notification that the entire graph has been measured.
|
void |
failedToAccessField(Object obj,
String fieldName,
Class<?> fieldType)
Notification that the graph could not be fully measured has it failed to access a field.
|
void |
fieldAdded(Object obj,
String fieldName,
Object fieldValue)
Notification that the field from the specified object has been added.
|
void |
objectMeasured(Object current,
long size)
Notification that the size of the specified object has been measured.
|
void |
started(Object obj)
Notification that
MemoryMeter as started analyzing the specified object. |
public void started(Object obj)
MemoryMeterListenerMemoryMeter as started analyzing the specified object.started in interface MemoryMeterListenerobj - the object being analyzedpublic void fieldAdded(Object obj, String fieldName, Object fieldValue)
MemoryMeterListenerfieldAdded in interface MemoryMeterListenerobj - the object for which a field has been addedfieldName - the field namefieldValue - the field valuepublic void arrayElementAdded(Object[] array, int index, Object elementValue)
MemoryMeterListenerarrayElementAdded in interface MemoryMeterListenerarray - the array for which an element has been addedindex - the element indexelementValue - the element valuepublic void objectMeasured(Object current, long size)
MemoryMeterListenerobjectMeasured in interface MemoryMeterListenercurrent - the object that has been measuredsize - the object size in bytespublic void byteBufferRemainingMeasured(ByteBuffer buffer, long size)
MemoryMeterListenerByteBuffer have been measured.byteBufferRemainingMeasured in interface MemoryMeterListenerbuffer - the ByteBuffersize - the remaining bytespublic void done(long size)
MemoryMeterListenerdone in interface MemoryMeterListenersize - the size of the entire graph.public void failedToAccessField(Object obj, String fieldName, Class<?> fieldType)
MemoryMeterListenerfailedToAccessField in interface MemoryMeterListenerobj - the object owning the field that could not be accessedfieldName - the field namefieldType - the field typeCopyright © 2023. All rights reserved.