Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8257658

Add gz option to SA jmap to write a gzipped heap dump

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 17
    • core-svc
    • None
    • minimal
    • only add new optional option. if not specified, the behavior is same as previous heap dump. so the risk is low
    • add/remove/modify command line option
    • JDK

      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]

            lzang Lin Zang
            lzang Lin Zang
            Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: