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

Adjust jmap -histo to accept "noparallel" option to inspect heap serially

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Withdrawn
    • Fix Version/s: None
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      The "parallel=[N]" option was introduced in JDK16 and with this change it would be removed, so the JDK16's "jmap -histo:parallel=[N]" command that communicate with newer hotspot will get an error.

      Description

      Summary

      The current "jmap -histo" command accepts a parallel=[N] option to indicate the number of parallel threads, which exposes too much details to user and makes spec hard to be clear and not to be ambiguous.

      Propose to enable parallel heap inspection by default and remove "parallel=[N]" option. Instead introduce a new option "noparallel" to allow user to do heap inspection non-parallel.

      Specification

      The change of jmap help info looks like:

      Usage:
      
      jmap -clstats <pid>
          to connect to running process and print class loader statistics
      jmap -finalizerinfo <pid>
          to connect to running process and print information on objects awaiting finalization
      jmap -histo[:[<histo-options>]] <pid>
          to connect to running process and print histogram of java object heap
      jmap -dump:<dump-options> <pid>
          to connect to running process and dump java heap
      jmap -? -h --help
          to print this help message
      
      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.
      
      Example: jmap -dump:live,format=b,file=heap.bin <pid>
      
      histo-options:
        live         count only live objects (takes precedence if both "live" and "all" are specified)
        all          count all objects in the heap (default if one of "live" or "all" is not specified)
        file=<file>  dump data to <file>
      - parallel=<number>  parallel threads number for heap iteration: 
      -                           parallel=0 default behavior, use predefined number of threads
      -                           parallel=1 disable parallel heap iteration
      -                           parallel=<N> use N threads for parallel heap iteration
      + noparallel   If specified, the heap is inspected serially.
      
      Example: jmap -histo:live,file=/tmp/histo.data <pid>

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lzang Lin Zang
              Reporter:
              mli Hamlin Li
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: