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

Kevin Walls kevinw at openjdk.org
Tue Mar 12 13:30:13 UTC 2024


On Tue, 12 Mar 2024 12:12:05 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> > jcmd GC.heap_dump has the overwrite flag.
> > OOM dumping in HeapDumper::dump_heap(bool oome) has a sequence number.
> 
> There is (with this patch) still just one sequence number and it is incremented by all invocations of alloc_and_create_heapdump_pathname.

Right, I was trying to say that previously, sequence numbers were only used by OOM dumping, and now jcmd invocation can use them, if you have it using HeapDumpPath.  (But it can't when using a specified filename, that might be a point of confusion.)

HeapDumpOnOutOfMemoryError dumping never overwrites as I read it.  That make sense as it could overwrite existing dumps if an OOM happens, and means a sequence of dumps should all have the same origin.

Invoked from jcmd with HeapDumpPath and -overwrite, can you can overwrite part of a sequence.
That's not necessarily wrong, and may not be serious enough to refuse -overwrite when using HeapDumpPath, but we want to find a way of making things clear (I was not going to suggest separate sequence numbers... 8-) )

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

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


More information about the serviceability-dev mailing list