./categories/server
Heap Dump OOM 자동 덤프
OOM 시 자동 Heap Dump
java -Xms128m -Xmx128m \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/home/jeus7/OOM/heapdump/ \
-verbose:gc -Xloggc:/home/jeus7/OOM/gc.log \
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps \
-classpath . HoldMemoryOOM
-Xms/-Xmx: 힙 최소·최대-XX:+HeapDumpOnOutOfMemoryError: OOM 시.hprof자동 생성-XX:HeapDumpPath: 덤프 저장 경로
OOM 출력 예:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to /home/jeus7/OOM/heapdump/java_pid4791.hprof ...
Heap dump file created [166556043 bytes in 0.979 secs]
분석: Eclipse Memory Analyzer(MAT), IBM Heap Analyzer 등으로 .hprof 열어 누수 객체 확인.
관련 링크: https://www.eclipse.org/mat/
./comments