I was following the steps mentioned here How to get a heap dump from Kubernetes k8s pod?
I'm able to get the the process id using top command inside the pod. However, when I run jmap I get this:
~ $ jmap
sh: jmap: not found
I access the pod with this command: kubectl exec -it -- sh
I also tried this command:
kubectl exec -it <pod> -- jmap -dump:live,format=b,file=heapdump.bin 1
But I was getting:
OCI runtime exec failed: exec failed: container_linux.go:349: starting container process caused "exec: \"jmap\": executable file not found in $PATH": unknown command terminated with exit code 126
Is there any other way to get the java heap dump from the pod?