Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8269685: Optimize HeapHprofBinWriter implementation
8262386: resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java timed out

Reviewed-by: sspitsyn, amenkov
  • Loading branch information
Lin Zang committed Sep 28, 2021
1 parent c880b87 commit 8876eae
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 344 deletions.
Expand Up @@ -59,7 +59,7 @@ public void prologue(long usedSize) {

public boolean doObj(Oop oop) {
try {
writeHeapRecordPrologue();
writeHeapRecordPrologue(calculateOopDumpRecordSize(oop));
if (oop instanceof TypeArray) {
writePrimitiveArray((TypeArray)oop);
} else if (oop instanceof ObjArray) {
Expand Down Expand Up @@ -127,6 +127,8 @@ public void epilogue() {
}
}

abstract protected int calculateOopDumpRecordSize(Oop oop) throws IOException;

protected void writeJavaThreads() throws IOException {
Threads threads = VM.getVM().getThreads();
for (int i = 0; i < threads.getNumberOfThreads(); i++) {
Expand Down Expand Up @@ -420,6 +422,9 @@ protected void writeHeapFooter() throws IOException {
protected void writeHeapRecordPrologue() throws IOException {
}

protected void writeHeapRecordPrologue(int size) throws IOException {
}

protected void writeHeapRecordEpilogue() throws IOException {
}

Expand Down
Expand Up @@ -275,6 +275,11 @@ protected void writeHeapFooter() throws IOException {
out.println("</gxl>");
}

@Override
protected int calculateOopDumpRecordSize(Oop oop) throws IOException {
return 0;
}

//-- Internals only below this point

// Java identifier to XML NMTOKEN type string
Expand Down

1 comment on commit 8876eae

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.