comparison agent/src/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @ 12820:8ef918538e22

6313383: SA: Update jmap to support HPROF binary format "JAVA PROFILE 1.0.2" Summary: Adds support for large(>4G) heap dumps in hprof format. Adds tests and updates testlibrary. Reviewed-by: sla, allwin Contributed-by: fredrik.arvidsson@oracle.com
author sla
date Fri, 04 Oct 2013 13:44:49 +0200
parents da91efe96a93
children de6a9e811145
comparison
equal deleted inserted replaced
12818:763705f0fec3 12820:8ef918538e22
57 } 57 }
58 } 58 }
59 59
60 public boolean doObj(Oop oop) { 60 public boolean doObj(Oop oop) {
61 try { 61 try {
62 writeHeapRecordPrologue();
62 if (oop instanceof TypeArray) { 63 if (oop instanceof TypeArray) {
63 writePrimitiveArray((TypeArray)oop); 64 writePrimitiveArray((TypeArray)oop);
64 } else if (oop instanceof ObjArray) { 65 } else if (oop instanceof ObjArray) {
65 Klass klass = oop.getKlass(); 66 Klass klass = oop.getKlass();
66 ObjArrayKlass oak = (ObjArrayKlass) klass; 67 ObjArrayKlass oak = (ObjArrayKlass) klass;
95 } 96 }
96 } else { 97 } else {
97 // not-a-Java-visible oop 98 // not-a-Java-visible oop
98 writeInternalObject(oop); 99 writeInternalObject(oop);
99 } 100 }
101 writeHeapRecordEpilogue();
100 } catch (IOException exp) { 102 } catch (IOException exp) {
101 throw new RuntimeException(exp); 103 throw new RuntimeException(exp);
102 } 104 }
103 return false; 105 return false;
104 } 106 }
414 } 416 }
415 417
416 protected void writeHeapFooter() throws IOException { 418 protected void writeHeapFooter() throws IOException {
417 } 419 }
418 420
421 protected void writeHeapRecordPrologue() throws IOException {
422 }
423
424 protected void writeHeapRecordEpilogue() throws IOException {
425 }
426
419 // HeapVisitor, OopVisitor methods can't throw any non-runtime 427 // HeapVisitor, OopVisitor methods can't throw any non-runtime
420 // exception. But, derived class write methods (which are called 428 // exception. But, derived class write methods (which are called
421 // from visitor callbacks) may throw IOException. Hence, we throw 429 // from visitor callbacks) may throw IOException. Hence, we throw
422 // RuntimeException with origianal IOException as cause from the 430 // RuntimeException with origianal IOException as cause from the
423 // visitor methods. This method gets back the original IOException 431 // visitor methods. This method gets back the original IOException