Use of jmap
- Mode 1
How to export java hprof file
# pid
ps -ef | grep xxxl-job-admin
# [root-10-1-94 data]# jmap -dump:form=b,file=/data/templ/xl-job-admin. prof 24663
# 24663: Enable to open socket file: target process not responding or HotSpot VM not loaded
# The -F option can be used when the target process is not responding to
# Example (PS: if command delivery provided by AI fails, Add-F parameter)
jmap -F -dump:format@@=b,file=/data/temp/xxl-job-admin. prof 24663
- Mode 2
Add parameters when the jar package starts
-Xms128M -Xmx128M -XX: +HeapDumpOnOutOfMemoryErr-XX:HeapDumpPath=../xfg-dev-tech-dump/docs/dump
# HeapDumpPath completes the path for your project to reach the dump folder.
# Run method will see the resulting log in docs/dump.