扫描现有项目的代码与配置,生成涵盖技术栈、结构、架构、规范、集成、测试和风险的七份文档。为结论标注文件依据和未知项,并指出计划描述与实际实现的差异。
- 了解陌生代码库
- 准备项目交接文档
- 对照设计资料与实际实现
使用 JDK 诊断工具,根据症状排查 Java 应用的高 CPU、内存不足和响应延迟。选择合适的数据采集方式并逐步缩小原因,同时说明采集开销和敏感数据的处理要求。
Symptom-first runtime diagnostics for JVM applications using JDK tools: jcmd, jstack, jmap, jstat, JFR, GC logs, async-profiler, Native Memory Tracking, and Eclipse MAT. Use when a Java app has high CPU, memory leaks or OutOfMemoryError, slow startup, deadlocks or thread starvation, long GC pauses, native memory growth, or slow requests. Includes permission tiers for safe use.
实测评分 未实测
查看安装方法本技能根据症状选择合适的诊断方法,排查 Java 应用的 CPU 高占用、内存问题、启动缓慢和响应延迟。它会使用 jcmd 和 jstack 查看线程信息,通过 jstat 和 GC 日志检查内存回收情况;必要时进一步使用 JFR 或 async-profiler 记录运行状态。建议多次采集数据,并结合另一种信息来源验证原因假设。
当 Java 应用运行缓慢或负载异常,而你不确定应该采集哪些信息时,可以使用本技能。它也涵盖死锁和 Java 堆外内存增长的排查。修复后,可以用相同方法重新测量并比较变化。
OutOfMemoryError 原因范围所需的数据采集步骤。”诊断工具应以目标 JVM 所属的同一操作系统用户身份运行。记录或连接操作需要用户同意;在生产环境诊断则需要明确指示。堆转储可能包含敏感信息,应在本地分析,不要分享,并在之后删除。采集时还需留意应用暂停和可用磁盘空间。
本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。
AI 根据 SKILL.md 的内容检查了需要注意的操作和使用前提。评分只依据实际运行的结果(实测对比)。
不计入评分。 由 AI(OpenAI Codex)于 2026年10月25日 评估。仅供参考,安装前请同时查看原文。
安装前可以查看交给 AI 代理的指令内容。
Pick the lightest tool that answers the question, starting from the symptom.
| Tier | Tools | Rule |
|---|---|---|
| 1. Read-only | jps -l, jcmd <pid> help/VM.version/VM.flags/Thread.print, jstat, jstack, reading logs | May run after stating the exact command. Class histograms (jcmd <pid> GC.class_histogram, jmap -histo, jmap -histo:live) are NOT Tier 1: they run heap inspection at a safepoint and can pause application threads on a large heap, so treat them as Tier 2 (consent, stated overhead). The default forms and -histo:live additionally force a full GC; -all=true / jmap -histo skip the full GC but still pause during the scan (and count unreachable objects). |
| 2. Recording / attach | JFR (JFR.start, -XX:StartFlightRecording), async-profiler, NMT (-XX:NativeMemoryTracking), enabling GC logs | Requires user consent. State duration and expected overhead (JFR default profile is about 1-2%; async-profiler depends on mode; NMT summary roughly 5-10%, detail more) before running. |
| 3. Intrusive / sensitive | Heap dumps (GC.heap_dump, jmap -dump), jhsdb, commands that print JVM arguments or system properties (jps -v/-lv/-m, bare jcmd, VM.system_properties, VM.command_line, jinfo, ps aux on a Java process; they can expose secrets, redact output), JDWP with suspend, anything on production | Requires explicit consent, a stated target path, free-disk check (a dump is about the size of the used heap), and a stated pause. Heap dumps contain secrets (passwords, tokens, personal data). Never share or upload them; redaction is NOT a reliable safeguard. Analyze locally and delete afterwards. |
Never run Tier 2 or Tier 3 commands against production unless the user explicitly instructs it. Run diagnostic tools as the same OS user as the target JVM. Prefer reproducing on dev or staging.
| Symptom | First step | Then | Reference |
|---|---|---|---|
| High CPU | Thread dumps x3 (Tier 1) + top -H to map hot native thread ids to nid | JFR or async-profiler CPU flame graph (Tier 2) | threads, jfr, async-profiler |
| Memory leak / OOM | jstat -gcutil, GC.class_histogram -all=true twice, minutes apart (Tier 2: safepoint pause even with -all=true; without it a full GC too; get consent on production) | Heap dump + Eclipse MAT (Tier 3) or JFR OldObjectSample (Tier 2) | heap, gc |
| Slow startup | -Xlog:class+load, framework startup/condition reports, timestamped logs | JFR from start, async-profiler wall-clock | jfr, async-profiler |
| Deadlock / thread starvation | jcmd <pid> Thread.print (reports deadlocks), compare dumps over time | Virtual threads: Thread.dump_to_file | threads |
| GC pauses | GC log (-Xlog:gc*) and jstat -gc | JFR GC events; tune collector/heap | gc |
| Native memory growth (RSS grows, heap does not) | Compare RSS vs heap; enable NMT, jcmd VM.native_memory baseline / summary.diff (Tier 2) | async-profiler nativemem or allocator tools | nmt, containers |
| Slow requests | Tracing/metrics and logs first; Actuator or Dev UI (see below) | JFR (socket/file/lock events), async-profiler wall-clock | jfr, async-profiler |
| JVM crash / hang, no tools respond | hs_err_pid*.log, core dump | jhsdb (Tier 3) | basics |
Start with jps/jcmd basics to identify the target JVM and confirm which JDK version is running.
JDK tools see the JVM; some questions (which endpoint, which SQL query, which bean) are easier at the application level. Optional options, in order of preference:
metrics, health, loggers, httpexchanges) and Quarkus Dev UI / Micrometer metrics are built in and need no extra tool. Expose Actuator endpoints minimally; For heapdump and threaddump, follow the policy in the spring-observability skill: never expose them over public HTTP; the only exception is a temporary, user-consented window with authentication, TLS and network restriction, removed afterwards.gh skill install jdubois/boot-ui skills/bootui.If considering BootUI:
Follow the project's own documentation for usage; this skill does not reproduce it.
See containers for attaching tools inside containers, -XX:MaxRAMPercentage, and cgroup memory limits.
java-debugging skill.Official docs (prefer them over this skill for the JDK in use; change 21 to your version): jcmd https://docs.oracle.com/en/java/javase/21/docs/specs/man/jcmd.html, jfr https://docs.oracle.com/en/java/javase/21/docs/specs/man/jfr.html, JFR guide https://docs.oracle.com/en/java/javase/21/jfr/introduction-jdk-flight-recorder.html, troubleshooting guide https://docs.oracle.com/en/java/javase/21/troubleshoot/, async-profiler releases https://github.com/async-profiler/async-profiler/releases.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
扫描现有项目的代码与配置,生成涵盖技术栈、结构、架构、规范、集成、测试和风险的七份文档。为结论标注文件依据和未知项,并指出计划描述与实际实现的差异。
使用AgentRC评估代码仓库对AI智能体的准备情况,并生成可独立打开的HTML报告。查看九个方面的评分和优先改进建议,也可按组织自定评分政策。
使用AgentRC分析项目代码中的语言、框架和开发惯例,生成或更新AI编程代理的指令文件。可集中写入一个文件,也可按主题和项目区域拆分,并在写入前预览改动。
按团队或组织标准调整AgentRC准备度评估。可选择或创建JSON策略,调整检查权重、停用无关检查、设置通过率,并在CI流程中设定自动检查门槛。
分析你提供的广告成效数据,找出浪费支出和表现较好的广告,并整理暂停、加预算或继续测试的候选项。还可比较不同平台、评估A/B测试差异,并提出预算调整建议。
为指定代码文件添加学习注释,解释语法、编程概念和设计选择;可按读者水平调整讲解深度和重复频率,并保持文件结构、编码与语法。