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

Add parallel heap iteration for jmap -histo

    XMLWordPrintable

Details

    • CSR
    • Resolution: Approved
    • P4
    • 16
    • core-svc
    • None
    • behavioral
    • minimal
    • This change adds only one option for jmap -histo. there should be minimal compatibility issues.
    • add/remove/modify command line option
    • JDK

    Description

      Summary

      Add a new sub-command option "parallel" to the existing "histo" jmap command line option, which specifies how many threads to use to generate the heap histogram.

      Problem

      "jmap -histo" inspects the heap serially, which takes a long time when the heap is large. Heap iteration time can be significantly reduced by parallel iteration over the object graph.

      Solution

      Add a new sub-command option "parallel" to the existing "histo" jmap command line option, which specifies how many threads to use to generate the heap histogram.

      Specification

      Updated specification.

      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
        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>
      
      Example: jmap -dump:live,format=b,file=heap.bin <pid>
      
      histo-options:
        live             count only live objects
        all              count all objects in the heap (default if one of "live" or "all" is not specified)
        file=<file>      dump data to <file>
        parallel=<count> generate histogram using this many parallel threads, default 0
                           0 use system determined number of threads
                           1 use one thread, i.e., disable parallelism
                           n use n threads, n must be positive
      
      Example: jmap -histo:live,file=/tmp/histo.data,parallel=5 <pid>

      Attachments

        Issue Links

          Activity

            People

              lzang Lin Zang
              jcbeyler Jean Christophe Beyler
              Volker Simonis
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: