Class GraphLayout
java.lang.Object
org.openjdk.jol.info.GraphLayout
Holds the object graph layout info.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<Long, GraphPathRecord> private booleanprivate intprivate final Stringprivate final List<GraphPathRecord> private longprivate longprivate booleanprivate booleanprivate booleanprivate longprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(GraphLayout another) Add another layout data to the current one.(package private) voidaddRecord(GraphPathRecord gpr) Answer the set of addresses for the discovered objectslongAnswer the ending address of observed memory chunkprivate voidprivate voidprivate voidAnswer the class countsAnswer the set of observed classesAnswer the class sizes.static GraphLayoutparseInstance(Object... roots) Parse the object graph starting from the given instance.record(long address) Get the object descriptor for the given addresslongAnswer the starting address of observed memory chunksubtract(GraphLayout another) Subtract another layout data from the current one.Get the stringly representation of footprint tablevoidPut the graphical representation of object graph into the file.Get the stringly representation of object graphlongAnswer the total instance countlongAnswer the total instance footprint
-
Field Details
-
gprs
-
description
-
processedHisto
private volatile boolean processedHisto -
classes
-
classSizes
-
classCounts
-
processedAddresses
private volatile boolean processedAddresses -
addresses
-
minAddress
private long minAddress -
maxAddress
private long maxAddress -
addressTries
private int addressTries -
addressStable
private boolean addressStable -
processedTotals
private volatile boolean processedTotals -
totalCount
private long totalCount -
totalSize
private long totalSize
-
-
Constructor Details
-
GraphLayout
-
-
Method Details
-
parseInstance
Parse the object graph starting from the given instance.- Parameters:
roots- root instances to start from- Returns:
- object graph
-
addRecord
-
ensureProcessedAddresses
private void ensureProcessedAddresses() -
subtract
Subtract another layout data from the current one. This method does not change the current data object, but produces another one. Note that the object identity is derived from object addresses: if some objects move, they will be treated as new/absent. You may want to quiesce the heap (possibly doing several back-to-back GCs) before taking the snapshots.- Parameters:
another- data object- Returns:
- new data object, that contains the difference.
-
add
Add another layout data to the current one. This method does not change the current data object, but produces another one. Note that the object identity is derived from object addresses: if some objects move, they will be treated as new. You may want to quiesce the heap (possibly doing several back-to-back GCs) before taking the snapshots.- Parameters:
another- data object- Returns:
- new data object, that contains the union.
-
ensureProcessedHisto
private void ensureProcessedHisto() -
getClassSizes
-
getClassCounts
-
getClasses
-
ensureProcessedTotals
private void ensureProcessedTotals() -
totalCount
public long totalCount()Answer the total instance count- Returns:
- total instance count
-
totalSize
public long totalSize()Answer the total instance footprint- Returns:
- total instance footprint, bytes
-
startAddress
public long startAddress()Answer the starting address of observed memory chunk- Returns:
- starting address
-
endAddress
public long endAddress()Answer the ending address of observed memory chunk- Returns:
- ending address
-
addresses
-
record
Get the object descriptor for the given address- Parameters:
address- address- Returns:
- object descriptor
-
toFootprint
Get the stringly representation of footprint table- Returns:
- footprint table
-
toPrintable
Get the stringly representation of object graph- Returns:
- linearized text form of object graph
-
toImage
Put the graphical representation of object graph into the file.- Parameters:
fileName- filename- Throws:
IOException- when I/O fails
-