请提供一个简单的分步指南,以查看来自 Kubernetes pod 的 Java 堆转储。
kubectl exec -it herle-deployment-pod-5757d89d85-wrpc9 bash
get the process id (top command)
Create java heap dump
jmap -dump:live,format=b,file=<file_name>.bin <process_id>
Example:
jmap -dump:live,format=b,file=application_heap_dump.bin 1
kubectl cp <pod_name>:<heap_file> <your local destination directory>
Example:
kubectl cp herle-deployment-pod-5757d89d85-wrpc9:/tmp/application_heap_dump.bin /Users/amritharajherle/Desktop/application_heap_dump.bin
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.