I have tried to take a heap dump using jcmd (from a git bash console window):
$ /c/Program\ Files/Java/jdk1.8.0_202/bin/jcmd 25156 GC.heap_dump filename=livetest-grindtohalt.hprof
25156:
Heap dump file created
However, the file does not seem to exist:
$ find -name livetest-grindtohalt.hprof
$
Where can I find it?
I had the same problem in windows.
jcmd 6232 GC.heap_dump filename=IShp1.hprof
it ran, said file created, but a search of c drive couldn't find it. Reran and got 'file exists'.
Tried with a path specified in filename, and a different file name,
jcmd 6232 GC.heap_dump filename=c:\temp\IShp2.hprof
This also got 'file exists'.
I conclude 'filename' is not being honored. Presumably jcmd is writing some internally-specified unknown file name to some unknown location, when the 'filename' is specified.
Instead
jcmd 6232 GC.heap_dump c:\temp\isHpdmp1.hprof
works and writes the file to the specified location.
So presumably for *nix
something like
jcmd 6232 GC.heap_dump /opt/temp/myHd.hprof
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With