Package org.graalvm.tools.insight.heap
Class HeapDump.ArrayBuilder
java.lang.Object
org.graalvm.tools.insight.heap.HeapDump.ArrayBuilder
- Enclosing class:
HeapDump
Fills data for new array to put into the
HeapDump.- Since:
- 21.3.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionDumps the gathered array values into theHeapDump.id()The ID assigned to the instance.put(int index, HeapDump.ObjectInstance value) Puts reference to another object into the array.
-
Method Details
-
put
Puts reference to another object into the array.- Parameters:
index- zero based index into the arrayvalue- reference to object in theHeapDump- Returns:
thisbuilder- Since:
- 21.3.2
-
dumpInstance
Dumps the gathered array values into theHeapDump.- Returns:
- object representing the written instance
- Throws:
UncheckedIOException- when an I/O error occurs- Since:
- 21.3.2
- See Also:
-
id
The ID assigned to the instance. Allows one to obtain ID of an instance before it is dumped into theHeapDump.HeapDump.InstanceBuilder mainBuilder = heap.newInstance(classMain); final ObjectInstance main = mainBuilder.id(); mainBuilder.put("tom", tom).put("jerry", jerry); ObjectInstance cathingThread = heap.newThread("Catching Jerry"). addStackFrame(classActor, "tom", "Actor.java", -1, jerry, tom, main). addStackFrame(classMain, "main", "Main.java", -1, main). dumpThread(); mainBuilder.put("thread", cathingThread).dumpInstance();- Returns:
- object reference for the instance that's going to be built when
dumpInstance()method is invoked - Since:
- 21.3.2
-