使用說明與技術參考
使用方式
本機 parser 依 thread header 分段、讀取 state 與 at frame,並把每個 thread stack 視為一筆 sample。
- 載入合成範例或貼上去識別化 dump。
- 檢查 thread、state 與 sample 數。
- 比較多次 dump 再判斷。
範例
- 輸入
thread-dump-minimal.txt- 輸出
2 threads;RUNNABLE 1;WAITING 1;samples 2
fixture 只含合成名稱。
- 輸入
只有 header、沒有 frame- 輸出
計入 thread;沒有 sampled frame
stack 可能無有效 frame。
- 輸入
一般文字- 輸出
0 threads
沒有 Java thread header。
結果欄位解讀
狀態數是單一快照。
圖寬表示 sample 數,不是 CPU 時間。
常見錯誤與限制
- RUNNABLE 不等於高 CPU。
- 不會自動證明 deadlock。
- dump 可能含敏感資料;解析在本機。
常見問題
- 這是 CPU flame graph 嗎?
- 不是,是 thread dump 的 sampled-stack view。
- 該收集幾份?
- 間隔數秒收集多份比單份可靠。