728x90
반응형

개발하면서 서비스 장애로 인해 덤프 파일을 분석해야할 일이 있습니다.

덤프 파일 생성 후 분석하는 방법에 대해 간단히 알아보겠습니다.

 

0. 프로세스 pid 조회하기

 : ps -ef | grep java

 : 실행중인 자바 프로세스 확인하는 명령어

 

1. 힙 덤프 (Heap dump)

 : 덤프 파일의 확장자는 .hprof

 jmap -dump:format=b,file=[덤프파일이름]_dump.hprof pid

 

힙덤프 분석 tool - Eclipse Memory Analyzer (MAT)

1) Eclipse Memory Analyzer (MAT) 다운받기

 : www.eclipse.org/mat/downloads.php

 

Eclipse Memory Analyzer Open Source Project | The Eclipse Foundation

The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 375 open source projects, including runtimes, tools and frameworks.

www.eclipse.org

 : OS버전에 맞게 다운

 

2) 사용법

 : spoqa.github.io/2012/02/06/eclipse-mat.html

 

Eclipse Memory Analyzer 소개

Eclipse Memory Analyzer(MAT)을 소개하고 유용하게 쓸 수 있는 기능들을 알아봅니다.

spoqa.github.io

2.  스레드덤프 (Thread dump)

 jstack -l pid >> [덤프파일이름]_thread_dump.log

 

2-1)스레드덤프 분석 사이트

fastthread.io/ft-index.jsp

 

fastthread.io

Thread Dump Analysis REST API In this modern world, thread dumps are still analyzed in a tedious & manual mode. i.e., Operations engineer captures thread dumps from the production servers; then he transmits those files to developers. Developers use thread

fastthread.io

3. 프로세스 스택 (pstack)

pstack은 프로세스의 스택 정보를 보여주는 명령어입니다.

쓰레드의 상태를 확인하는 용도로 사용합니다.

pstack $pid >> [프로세스스택명]_pstack.txt

728x90
반응형

+ Recent posts