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

Add option to jcmd to write a gzipped heap dump

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 15
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      svc
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      We only add additional flags.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      JDK

      Description

      Summary

      Add an option to write a gzip compressed heap dump via the GC.heap_dump diagnostic command.

      Problem

      With ever increasing heap sizes, the creation of heap dumps takes long and uses more space.

      Solution

      Add an option to directly write a gzipped heap dump via the diagnostic command GC.heap_dump. Since the deflate mechanism used in the gzip format is relatively slow, the compression is done in parallel.

      When writing to a slow backing store, compression can lead to faster writing of the heap dump. And in practically all cases a compression rate of about 3 or more should be achieved.

      The diagnostic command can be accessed via the jcmd tool. An example would be:

      jcmd <pid|main class> GC.heap_dump -gz=4 dump.hprof.gz

      This would trigger a gzip compressed heap dump of the specified VM, using a compression level of 4.

      For a discussion of alternative solutions see https://mail.openjdk.java.net/pipermail/serviceability-dev/2020-February/030369.html

      Specification

      Add an integer option called gz to the GC.heap_dump diagnostic command. If it is specified, it will enable the gzip compression of the written heap dump. The supplied value is the compression level. It can range from 1 (fastest) to 9 (slowest, but best compression). The recommended level is 1.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rschmelter Ralf Schmelter
                Reporter:
                rschmelter Ralf Schmelter
                Reviewed By:
                Christoph Langer, Goetz Lindenmaier, Serguei Spitsyn
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: