jmap은 JVM을 모니터링할 수 있는 도구이며, cmd에서 명령어로 사용한다.
힙덤프 뜨라고 하면 jmap으로 하면 된다.
2. 주요 명령어
1) heap 요약 보기
# jmap -heap [pid]
2) heap dump 뜨기
- heap dump 파일 생성: jmap -dump:format=b,file=[파일명] [PID]
ex) # jmap -dump:format=b,file=heapdump20210224.hprof 2626
1. jmap 사용법
jmap의 사용법은 다음과 같다.
# jmap
Usage:
jmap [option] <pid>
(to connect to running process)
jmap [option] <executable <core>
(to connect to a core file)
jmap [option] [server_id@]<remote server IP or hostname>
(to connect to remote debug server)
where <option> is one of:
<none> to print same info as Solaris pmap
-heap to print java heap summary
-histo[:live] to print histogram of java object heap; if the "live"
suboption is specified, only count live objects
-clstats to print class loader statistics
-finalizerinfo to print information on objects awaiting finalization
-dump:<dump-options> to dump java heap in hprof binary format
dump-options:
live dump only live objects; if not specified,
all objects in the heap are dumped.
format=b binary format
file=<file> dump heap to <file>
Example: jmap -dump:live,format=b,file=heap.bin <pid>
-F force. Use with -dump:<dump-options> <pid> or -histo
to force a heap dump or histogram when <pid> does not
respond. The "live" suboption is not supported
in this mode.
-h | -help to print this help message
-J<flag> to pass <flag> directly to the runtime system
'Programming > JAVA' 카테고리의 다른 글
JMeter로 JAVA Thread 테스트하기 (0) | 2021.04.14 |
---|---|
JMeter 설치하기 (0) | 2021.04.14 |
Ant failed to create task or type scp (0) | 2021.04.11 |
JAVA 메모리 테스트를 위한 jvisualvm 실행하기 (0) | 2021.02.24 |
JAVA 문자열 정규표현식 치팅 POST IT (0) | 2021.02.16 |