RFR: 8257234 : Add gz option to SA jmap to write a gzipped heap dump [v13]

Chris Plummer cjplummer at openjdk.java.net
Thu Jan 28 22:47:46 UTC 2021


On Wed, 27 Jan 2021 23:54:58 GMT, Lin Zang <lzang at openjdk.org> wrote:

>> 8257234 : Add gz option to SA jmap to write a gzipped heap dump
>
> Lin Zang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   fix the logic of using gz= as file name

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java line 64:

> 62:         System.err.println("                             \t1 (recommended) is the fastest, 9 the strongest compression.");
> 63:         System.out.println("    -heap:format=x           \tTo dump java heap in GXL format.");
> 64:         System.out.println("                             \tPlease be aware that \"gz\" option is not valid for heap dump in GXL format.");

I just noticed that there is a (pre-existing) `file=<dumpfile>` argument that can be used with `-heap:format=` to specify the dumpfile name. Otherwise it dumps to `heap.bin`. It's not currently documented. I think it's enough to just add `[,file=<dumpfile>]` to the argument syntax. No description should be necessary.

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/JMap.java line 53:

> 51: 
> 52:     protected String getCommandFlags() {
> 53:         return "-heap|-heap:format=b[,gz=<1-9>]|-histo|-clstats|-finalizerinfo";

This is missing `format=x` and also needs `file=<dumpfile>`

-------------

PR: https://git.openjdk.java.net/jdk/pull/1712


More information about the serviceability-dev mailing list