RFR: JDK-8327769: jcmd GC.heap_dump without options should write to location given by -XX:HeapDumpPath, if set

Matthias Baesken mbaesken at openjdk.org
Tue Mar 12 12:11:12 UTC 2024


On Mon, 11 Mar 2024 11:57:04 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> Currently jcmd command GC.heap_dump only works with an additionally provided file name.
> Syntax : GC.heap_dump [options] <filename>
> 
> In case the JVM has the XX - flag HeapDumpPath set, we should support an additional mode where the <filename> is optional.
> In case the filename is NOT set, we take the HeapDumpPath (file or directory);
> 
> new syntax :
> GC.heap_dump [options] <filename> .. has precedence over second option
> GC.heap_dump [options] …in case -XX: HeapDumpPath=p is set
> 
> This would be a simplification e.g. for support cases where a filename or directory is set at JVM startup with -XX: HeapDumpPath=p and writing to the path is intended/recommended for usage also in the jcmd case.

Hi Kevin, thanks for the comments.

> globals.hpp documents HeapDumpPath as relating to HeapDumpOnOutOfMemoryError

Yes true, probably we have to adjust the related text.
What do you think about this 

old  "When HeapDumpOnOutOfMemoryError is on,"
new "When HeapDumpOnOutOfMemoryError is on or a heap dump is trigger by jcmd GC.heap_dump  without specifying a path,"

?

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

PR Comment: https://git.openjdk.org/jdk/pull/18190#issuecomment-1991504498


More information about the hotspot-runtime-dev mailing list