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>