APIdia Launch Partner
Top Description Fields Constructors Methods
sun.jvm.hotspot.utilities

public Class HeapGXLWriter

extends AbstractHeapGraphWriter
Class Inheritance
Imports
java.io.*, java.util.*, sun.jvm.hotspot.oops.*, sun.jvm.hotspot.runtime.*

This class writes Java heap in Graph eXchange Language (GXL) format. GXL is an open standard for serializing arbitrary graphs in XML syntax.

A GXL document contains one or more graphs. A graph contains nodes and edges. Both nodes and edges can have attributes. graphs, nodes, edges and attributes are represented by XML elements graph, node, edge and attr respectively. Attributes can be typed. GXL supports locator, bool, int, float, bool, string, enum as well as set, seq, bag, tup types. Nodes must have a XML attribute 'id' that is unique id of the node in the GXL document. Edges must have 'from' and 'to' XML attributes that are ids of from and to nodes.

Java heap to GXL document mapping:

Java primitive to GXL type mapping:

Exact Java primitive type code is written in 'kind' attribute of 'attr' element. Type code is specified in JVM spec. second edition section 4.3.2 (Field Descriptor).
See Also
GXL, GXL DTD

Field Summary

Modifier and TypeField and Description
private static final String
private boolean
private PrintWriter
private List<OopField>
Inherited from sun.jvm.hotspot.utilities.AbstractHeapGraphWriter:
javaLangClassjavaLangStringjavaLangThread

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected int
private static String
private static String
getID(Oop oop)

private static String
public void
write(String fileName)

Implements sun.jvm.hotspot.utilities.HeapGraphWriter.write.

writes the heap graph in the given file

private void
private void
writeAttribute(String name, String type, String value)

protected void
protected void
protected void
protected void
protected void
private void
writeEdge(Oop from, Oop to, String name)

private void
writeField(Field field, String type, String kind, String value)

protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
protected void
private void
Inherited from sun.jvm.hotspot.utilities.AbstractHeapGraphWriter:
handleRuntimeExceptionisJavaVisiblewritewriteGlobalJNIHandlewriteGlobalJNIHandleswriteHeapRecordEpiloguewriteHeapRecordProloguewriteHeapRecordProloguewriteInstancewriteInternalObjectwriteJavaThreadwriteJavaThreadswriteObjectwriteObjectFieldswriteObjectFieldswriteStickyClasseswriteStringwriteThread

Field Detail

ENCODINGback to summary
private static final String ENCODING
isArrayback to summary
private boolean isArray
outback to summary
private PrintWriter out
refFieldsback to summary
private List<OopField> refFields

Constructor Detail

HeapGXLWriterback to summary
public HeapGXLWriter()

Method Detail

calculateOopDumpRecordSizeback to summary
protected int calculateOopDumpRecordSize(Oop oop) throws IOException

Implements abstract sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.calculateOopDumpRecordSize.

Annotations
@Override
escapeXMLCharsback to summary
private static String escapeXMLChars(String s)
getIDback to summary
private static String getID(Oop oop)
identifierToXMLNameback to summary
private static String identifierToXMLName(String name)
writeback to summary
public void write(String fileName) throws IOException

Implements sun.jvm.hotspot.utilities.HeapGraphWriter.write.

Doc from sun.jvm.hotspot.utilities.HeapGraphWriter.write.

writes the heap graph in the given file

writeArrayLengthback to summary
private void writeArrayLength(Array array) throws IOException
writeAttributeback to summary
private void writeAttribute(String name, String type, String value)
writeBooleanFieldback to summary
protected void writeBooleanField(Oop oop, BooleanField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeBooleanField.

writeByteFieldback to summary
protected void writeByteField(Oop oop, ByteField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeByteField.

writeCharFieldback to summary
protected void writeCharField(Oop oop, CharField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeCharField.

writeClassback to summary
protected void writeClass(Instance instance) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeClass.

writeDoubleFieldback to summary
protected void writeDoubleField(Oop oop, DoubleField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeDoubleField.

writeEdgeback to summary
private void writeEdge(Oop from, Oop to, String name) throws IOException
writeFieldback to summary
private void writeField(Field field, String type, String kind, String value) throws IOException
writeFloatFieldback to summary
protected void writeFloatField(Oop oop, FloatField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeFloatField.

writeHeapFooterback to summary
protected void writeHeapFooter() throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeHeapFooter.

writeHeapHeaderback to summary
protected void writeHeapHeader() throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeHeapHeader.

writeIntFieldback to summary
protected void writeIntField(Oop oop, IntField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeIntField.

writeLongFieldback to summary
protected void writeLongField(Oop oop, LongField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeLongField.

writeObjectArrayback to summary
protected void writeObjectArray(ObjArray array) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeObjectArray.

writeObjectFooterback to summary
protected void writeObjectFooter(Oop oop) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeObjectFooter.

writeObjectHeaderback to summary
protected void writeObjectHeader(Oop oop) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeObjectHeader.

writePrimitiveArrayback to summary
protected void writePrimitiveArray(TypeArray array) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writePrimitiveArray.

writeReferenceFieldback to summary
protected void writeReferenceField(Oop oop, OopField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeReferenceField.

writeShortFieldback to summary
protected void writeShortField(Oop oop, ShortField field) throws IOException

Overrides sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.writeShortField.

writeVMInfoback to summary
private void writeVMInfo() throws IOException