Hotpath는 JFR 파일을 기반으로 CPU / GC / Allocation / Lock / Thread 상태를 자동 분석합니다. 아래 가이드를 따라 녹화하면 Hotpath가 필요한 대부분의 신호를 수집할 수 있습니다.
| 카테고리 | JFR 이벤트 | default | profile | Hotpath 권장 |
|---|---|---|---|---|
| CPU 사용률 | jdk.CPULoad |
✅ | ✅ | ✅ |
| Hot Methods | jdk.ExecutionSample |
✅ | ✅ | ✅ (10~20ms) |
| GC 이벤트 | jdk.GarbageCollection |
✅ | ✅ | ✅ |
| 힙 사용량 | jdk.GCHeapSummary |
✅ | ✅ | ✅ |
| 객체 할당 (TLAB) | jdk.ObjectAllocationInNewTLAB |
❌ | ✅ | 선택 |
| 객체 할당 (Outside) | jdk.ObjectAllocationOutsideTLAB |
❌ | ✅ | 선택 |
| Lock Contention | jdk.JavaMonitorEnter |
❌ | 일부 | ✅ (threshold 조정) |
| Thread Park | jdk.ThreadPark |
❌ | 일부 | ✅ |
| 스레드 통계 | jdk.JavaThreadStatistics |
✅ | ✅ | ✅ |
| JVM 정보 | jdk.JVMInformation |
✅ | ✅ | ✅ |
- 일반 분석 →
profile.jfc사용 - Lock / Allocation까지 깊게 보려면 →
hotpath.jfc사용 - 운영 환경에서는 오버헤드를 고려해 Allocation 이벤트는 상황에 따라 끄는 것을 권장
애플리케이션 시작할 때 바로 녹화
java \
-XX:StartFlightRecording=filename=hotpath-%t.jfr,settings=profile,dumponexit=true \
-jar app.jar%t: 시간 기반 파일명 (덮어쓰기 방지)profile: Hotpath 분석에 적합한 설정dumponexit=true: 정상 종료 시 자동 저장
Lock contention과 Allocation까지 모두 보고 싶다면 Hotpath 전용 설정 파일을 사용합니다.
java \
-XX:StartFlightRecording=filename=hotpath-%t.jfr,settings=/path/to/hotpath.jfc,dumponexit=true \
-jar app.jarjava \
-XX:StartFlightRecording=filename=hotpath-%t.jfr,settings=profile,duration=120s \
-jar app.jar테스트 구간만 측정할 때 사용합니다.
jps -ljcmd <PID> JFR.start name=hotpath settings=profile filename=hotpath.jfrjcmd <PID> JFR.checkjcmd <PID> JFR.dump name=hotpath filename=hotpath.jfrjcmd <PID> JFR.stop name=hotpathHotpath는 아래 이벤트를 활성화하는 설정을 권장합니다.
<event name="jdk.ExecutionSample">
<setting name="enabled">true</setting>
<setting name="period">10 ms</setting>
</event>
<event name="jdk.JavaMonitorEnter">
<setting name="enabled">true</setting>
<setting name="threshold">1 ms</setting>
</event>
<event name="jdk.ThreadPark">
<setting name="enabled">true</setting>
<setting name="threshold">1 ms</setting>
</event>
<event name="jdk.ObjectAllocationInNewTLAB">
<setting name="enabled">true</setting>
</event>
<event name="jdk.ObjectAllocationOutsideTLAB">
<setting name="enabled">true</setting>
</event>ExecutionSample10ms → 더 정밀하지만 약간의 오버헤드 증가- Allocation 이벤트는 트래픽 많은 운영 서버에서는 오버헤드 증가 가능
- Lock 분석이 필요 없다면 threshold를 높이거나 비활성화 가능
| 설정 | 예상 오버헤드 | 사용 권장 |
|---|---|---|
| default | ~1% | 운영 상시 |
| profile | ~2% | 개발 / 스테이징 |
| hotpath (alloc 포함) | ~2–5% | 성능 분석 세션 |
실제 오버헤드는 워크로드에 따라 달라질 수 있습니다.
장시간 녹화 시 디스크 사용을 제한하세요.
-XX:StartFlightRecording=filename=hotpath-%t.jfr,settings=profile,maxsize=1G,maxage=30mmaxsize: 최대 파일 크기maxage: 오래된 데이터 자동 삭제
| 목적 | 추천 설정 |
|---|---|
| 운영 모니터링 | default |
| 일반 성능 분석 | profile |
| GC + Allocation + Lock 심층 분석 | hotpath.jfc |