I'm trying to get a Java heap dump out of a GKE container.
First I connect to the container:
kubectl debug -it my-pod --image adoptopenjdk/openjdk11:latest --target=my-container -- bash
Then I run:
jmap -dump:live,format=b,file=heap_dump.hprof <pid of my java program>
The program returns instantly, having outputted:
Heap dump file created
However there is no file to be found.
I'm trying to get a Java heap dump out of a GKE container.
First I connect to the container:
kubectl debug -it my-pod --image adoptopenjdk/openjdk11:latest --target=my-container -- bash
Then I run:
jmap -dump:live,format=b,file=heap_dump.hprof <pid of my java program>
The program returns instantly, having outputted:
Heap dump file created
However there is no file to be found.
Share Improve this question asked 1 hour ago Carl Patenaude PoulinCarl Patenaude Poulin 6,5895 gold badges29 silver badges55 bronze badges1 Answer
Reset to default 0jmap
creates the heap dump file in the file system of the original container, found at /proc/1/root
.