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

Add gz option to jmap to write a gzipped heap dump

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 16
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Only add "gz" option, and this option is not enabled by default, so the risk is minimal
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      Add an option to write a gzip compressed heap dump via the jmap -dump command

      Problem

      There has been gz option for jcmd GC.heap_dump diagnostic command (JDK-8237354), adding the same option to jmap -dump command could help user get compressed heap dump file with jmap.

      Solution

      Add an "gz=" option to support write compressed heap dump file via jmap -dump command.

      An example would be:

      jmap -dump:gz=4,file=heapdump.gz [pid]

      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 jmap -dump command. 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

           dump-options:
             live         dump only live objects (takes precedence if both "live" and "all" are specified)
             all          dump all objects in the heap (default if one of "live" or "all" is not specified)
             format=b     binary format
             file=<file>  dump heap to <file>
       +     gz=<number>  If specified, the heap dump is written in gzipped format using the given compression level.
       +                  1 (recommended) is the fastest, 9 the strongest compression.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lzang Lin Zang
              Reporter:
              lzang Lin Zang
              Reviewed By:
              Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: