Prompts-MCP 686 skills · ai / design / design-pattern / framework / fundamentals / habit / lang / tech-selection /mcp/sse
fundamentals fundamentals/troubleshooting/index.md medium

fundamentals-troubleshooting-index

Java 线上故障排查四件事 — CPU 飙高 / 内存泄漏 OOM / Arthas 在线诊断 / 按症状分流的决策树。Use when 线上 CPU 打满 / 内存涨爆 / 接口变慢 / 选排查手段时。

子项索引

子项 一句话
troubleshooting-cpu-high skill CPU 飙高定位 — top -H -p 找占用最高的线程,把线程 id 转十六进制,在 jstack 输出里匹配 nid 找到 RUNNABLE 线程栈
troubleshooting-memory-leak skill 内存泄漏/OOM 定位 — jmap dump 堆快照,用 MAT 看支配树和最大对象,沿 GC Roots 引用链找住对象不放的根因
troubleshooting-arthas-online skill Arthas 免重启在线诊断 — watch 看方法入参/返回/异常,trace 按调用链拆方法耗时定位慢点,profiler 出火焰图找热点,全程不停服不改代码
troubleshooting-diagnosis-decision-tree skill 线上排查总决策树 — 先按症状分流:CPU 高走 top+jstack,内存涨/OOM 走 jmap+MAT,接口变慢走 Arthas trace + GC 日志,偶发抖动走链路追踪

线上排查 · 子项索引

线上故障排查拆成四个独立决策点:先用决策树按症状分流,再下钻到具体手段。

你在做什么 进哪个
不确定该用哪种工具,先按症状(CPU/内存/变慢/偶发)分流 diagnosis-decision-tree
CPU 占用打满,要定位是哪段代码在烧 CPU cpu-high
内存持续上涨 / 抛 OutOfMemoryError,要找泄漏的对象 memory-leak
想免重启在线看方法入参出参 / 方法耗时 / 火焰图 arthas-online