On Thu, 4 Feb 2021 23:23:41 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:

>> Thanks for the thorough list, I have tested most of them but not all. I will 
>> cover them and update here later.
>> 
>>> So really there are two implementations of heap dumping, one in the VM and 
>>> one in SA, but a total of 5 ways to get to them. I'm just starting to get 
>>> my head wrapped around all this myself. We've created a very confusing 
>>> situation for us, and unfortunately I think some of the changes that got us 
>>> here was driven by a goal to simply things.
>> 
>> Yes, it makes me even curious about why there can be two different 
>> implementation of them (one by C++ and one by Java),  it seems we need 
>> double the work of adding new options for those tools, like parallal for 
>> jmap histo and dump, etc.
>
> One implementation is in the JVM itself, to be used when the JVM is still 
> running well, and not just from command line tools. Heap dumping can also be 
> triggered by the JVM itslef by setting flags like -XX:+HeapDumpBeforeFullGC. 
> The other implementation is in SA, to be used on a core file or a hung JVM 
> process, although it can also be used on a JVM that is still running well. 
> BTW, there used to be a 3rd implementation. The old hprof profiler (a JVMTI 
> agent) also was used to generate hprof files.

Dear @plummercj,

> `--dumpfile` and `--gz` can only be used with `--binaryheap`. That should be 
> made clear in the help text.

I added indentation for these two sub-options.

> * SA's `jhsdb jmap --binaryheap` (which uses JMap.java with `-heap:format=b`)
> * SA's clhsdb `dumpheap` command (which also uses JMap.java with 
> `-heap:format=b`)
> * executing  SA's `sun/jvm/hotspot/tools/JMap` class directly
> * `jmap -dump` command (Uses Attach API's `heapdump` command, which uses 
> hotspot `HeapDump` class)
> * `GC.heap_dump` dcmd, which also uses the hotspot `HeapDumper` class
All 5 commands help message have been tested.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1712

Reply via email to