Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8251848: JMap.histo() and JMap.dump() should parse sub-arguments simi…
…larly

Update JMap histo/dump parsing code

Reviewed-by: sspitsyn, phh
  • Loading branch information
Lin Zang committed Aug 24, 2020
1 parent 77f82b3 commit 8bb092be767c123a9a6dc5362e4fd0cd6163316a
Showing 1 changed file with 7 additions and 1 deletion.
@@ -181,7 +181,7 @@ private static void histo(String pid, String options)
} else if (subopt.startsWith("file=")) {
filename = parseFileName(subopt);
if (filename == null) {
System.err.println("Fail: invalid option or no file name '" + subopt +"'");
System.err.println("Fail: invalid option or no file name '" + subopt + "'");
usage(1);
}
} else if (subopt.startsWith("parallel=")) {
@@ -218,6 +218,10 @@ private static void dump(String pid, String options)
liveopt = "-live";
} else if (subopt.startsWith("file=")) {
filename = parseFileName(subopt);
if (filename == null) {
System.err.println("Fail: invalid option or no file name '" + subopt + "'");
usage(1);
}
} else if (subopt.equals("format=b")) {
// ignore format (not needed at this time)
} else {
@@ -231,6 +235,8 @@ private static void dump(String pid, String options)
usage(1);
}

System.out.flush();

// dumpHeap is not the same as jcmd GC.heap_dump
executeCommandForPid(pid, "dumpheap", filename, liveopt);
}

0 comments on commit 8bb092b

Please sign in to comment.