Summary
Add an option to write a gzip compressed heap dump via the SA jmap.
Problem
There has been gz option for jcmd GC.heap_dump diagnostic command (JDK-8237354), and jmap command (JDK-8256451). Adding the same option to SA jmap could help user get compressed heap dump file with jhsdb commands such as 'jhsdb jmap' and 'heapdump' of 'jhsdb clhsdb'.
Solution
Add an "gz=[1-9]" option to support writing a compressed heap dump file. Several commands/subcommands will have "gz=" option added.
An example would be:
jhsdb jmap --binaryheap --gz=4 --dumpfile=dump.gz --pid 1234
or
jhsdb clhsdb; attach 1234; dumpheap gz=4 dump.gz
This would trigger a gzip compressed heap dump of the specified VM, using a compression level of 4.
Specification
Add an integer option called gz to the jhsdb heap dump related subcommands. Please see following diffs in specification. If it is specified, it will enable the gzip compression of the written heap dump. The supplied value is the compression level. The value can range from 1 (fastest) to 9 (slowest, but best compression). The recommended level is 1.
Diff of Specificaion
jhsdb jmap --help:
--dumpfile <name> The name of the dump file.
+ --gz <1-9> The compress level for gziped dump file.
--histo To print histogram of java object heap.
help message of jhsdb clhsdb:
- dumpheap [filename]
+ dumpheap [gz=<1-9>] [filename]
- csr of
-
JDK-8257234 Add gz option to SA jmap to write a gzipped heap dump
-
- Resolved
-