本文へ移動
cccskills
無料GitHub で公開日本語紹介

java-diagnostics

JavaアプリのCPU高負荷やメモリ不足、応答遅延を症状から調べ、JDKの診断ツールで原因を絞り込みます。採取時の負荷や機密情報の扱いも整理します。

原文原文の説明を見る

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.

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • CPU高負荷の原因を調べたいとき
  • メモリリークやOOMを調べたいとき
  • デッドロックや応答遅延の調査
  • GCによる長い停止の調査

日本語での紹介

できること

JavaアプリのCPU高負荷、メモリ不足、起動や応答の遅さを、症状に合う診断手段で調べます。jcmdやjstackによるスレッド情報、jstatやGCログによるメモリ回収状況を確認し、必要に応じて実行状況を記録するJFRやasync-profilerへ進みます。複数回の採取と別の情報源を組み合わせ、原因の仮説を検証する流れを示します。

こんなときに便利

Javaアプリが重いものの、何を採取すべきか分からないときに向いています。デッドロックや、Javaのヒープ外で増えるメモリの調査にも使えます。修正後は同じ方法で再測定し、変化を確かめます。

使い方の例

  • 「CPU使用率が高いJavaプロセスを、スレッド情報から調べて」
  • 「OutOfMemoryErrorの原因を絞るための採取手順を整理して」

注意点

診断ツールは対象JVMと同じOSユーザーで実行します。記録や接続を伴う操作には同意が必要で、本番環境には明示的な指示が求められます。ヒープダンプは機密情報を含むため、共有せずローカルで解析し、削除する方針です。採取時の停止やディスク容量にも注意します。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

資料チェック

SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。

安全面送信・削除・コマンド実行などの扱いが明示されているか
A良好階層別に同意条件と負荷を示し、ダンプのローカル解析・削除を指示する。
導入のしやすさ必要なツールや API キーが少ないか、書かれているか
B一部不足JDK診断ツールに加え任意のActuator等を挙げるが、導入手順は一部のみ。

点数には入れていません。 2026年10月25日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。

評価が違うと思ったら、見直しを依頼する

どの項目が、なぜ違うと思うかを書いてください。ログインは不要です。内容を SKILL.md と照らし合わせて評価を作り直し、この欄に反映します。

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

含まれるファイル(9)

  • SKILL.md7.2 KB
  • references/async-profiler.md3.0 KB
  • references/containers.md1.7 KB
  • references/gc.md1.6 KB
  • references/heap.md3.0 KB
  • references/jcmd-basics.md1.9 KB
  • references/jfr.md2.3 KB
  • references/native-memory.md1.5 KB
  • references/thread-dumps.md3.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Java Diagnostics

Pick the lightest tool that answers the question, starting from the symptom.

Permission tiers (obey them)

TierToolsRule
1. Read-onlyjps -l, jcmd <pid> help/VM.version/VM.flags/Thread.print, jstat, jstack, reading logsMay 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 / attachJFR (JFR.start, -XX:StartFlightRecording), async-profiler, NMT (-XX:NativeMemoryTracking), enabling GC logsRequires 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 / sensitiveHeap 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 productionRequires 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.

Decision table

SymptomFirst stepThenReference
High CPUThread dumps x3 (Tier 1) + top -H to map hot native thread ids to nidJFR or async-profiler CPU flame graph (Tier 2)threads, jfr, async-profiler
Memory leak / OOMjstat -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 logsJFR from start, async-profiler wall-clockjfr, async-profiler
Deadlock / thread starvationjcmd <pid> Thread.print (reports deadlocks), compare dumps over timeVirtual threads: Thread.dump_to_filethreads
GC pausesGC log (-Xlog:gc*) and jstat -gcJFR GC events; tune collector/heapgc
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 toolsnmt, containers
Slow requestsTracing/metrics and logs first; Actuator or Dev UI (see below)JFR (socket/file/lock events), async-profiler wall-clockjfr, async-profiler
JVM crash / hang, no tools respondhs_err_pid*.log, core dumpjhsdb (Tier 3)basics

Start with jps/jcmd basics to identify the target JVM and confirm which JDK version is running.

Workflow

  1. Capture the symptom precisely (when, how often, since which change, JDK version, container limits).
  2. Choose the tier needed; state the command, its overhead, and output location, and get consent for Tier 2/3.
  3. Collect data to a dedicated directory, with timestamps. Prefer several samples over one.
  4. Form a hypothesis from the data, then confirm with a second source (for example a thread dump plus a flame graph).
  5. Fix, re-measure with the same method, and clean up artifacts (dumps, recordings).

Application-level insights (optional)

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:

  • Spring Boot Actuator (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.
  • BootUI (https://github.com/jdubois/boot-ui , https://www.julien-dubois.com/boot-ui/): a local-only developer console with an opt-in MCP server for Spring Boot and Quarkus. Optional. Its skill can be installed with gh skill install jdubois/boot-ui skills/bootui.

If considering BootUI:

  • Ask the user for consent before adding any dependency or installing the skill.
  • Use it in a local/dev profile only; never expose it on a network, and never enable its heap dump, thread dump endpoints or MCP server in production.
  • Check the capability and version first (read its README for the supported Spring Boot / Quarkus versions) instead of assuming features.

Follow the project's own documentation for usage; this skill does not reproduce it.

Containers

See containers for attaching tools inside containers, -XX:MaxRAMPercentage, and cgroup memory limits.

References

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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

acquire-codebase-knowledge

無料概要あり

既存プロジェクトのコードや設定を調べ、技術構成・設計・規約・テスト・懸念点などを7つの文書に整理します。根拠のファイルと不明点も明記し、引き継ぎに役立てます。

  • 初めて触るコードの全体像を知りたいとき
  • プロジェクトの引き継ぎ資料作成
  • 設計資料と実装の違いを確認
github/awesome-copilot4万2026年10月24日 更新

acreadiness-assess

無料概要あり

リポジトリのAI活用準備度をAgentRCで評価し、9つの観点のスコアや改善案をHTMLにまとめます。組織独自の採点方針にも対応します。

  • AIエージェント導入前の準備度確認
  • 評価結果から改善の優先順位を決めたいとき
  • 組織独自の基準で採点したいとき
github/awesome-copilot4万2026年10月24日 更新

実際のコードから言語や開発ルールを読み取り、AIコーディングエージェント向けの指示ファイルを生成。プロジェクト全体や領域別にルールを整理します。

  • VS Code Copilot向け指示を作成
  • 開発ルールの変更を指示に反映
  • モノレポの領域別ルールを整理
github/awesome-copilot4万2026年10月24日 更新

acreadiness-policy

無料概要あり

AgentRCの準備度評価を、組織やチームの基準に合わせて調整します。チェックの重みや合格率、除外項目を設定し、CIでの合否判定にも使えます。

  • 組織共通の評価基準づくり
  • AI関連の整備状況だけを評価
  • チェックの重要度を調整したいとき
github/awesome-copilot4万2026年10月24日 更新

ad-campaign-analyzer

無料概要あり

広告の実績データから無駄な支出と成果の高い施策を見つけ、停止・増額・検証の候補を整理します。媒体をまたぐ予算配分の見直しやA/Bテストの評価にも使えます。

  • 停止すべき広告やキーワードの特定
  • 増額候補のキャンペーンや配信対象の発見
  • A/Bテスト結果の有意性を確認したいとき
github/awesome-copilot4万2026年10月24日 更新

add-educational-comments

無料概要あり

指定したコードファイルに、構文や設計の理由を説明する学習用コメントを追加します。読む人の知識に合わせて解説の深さや繰り返し、注釈番号の有無を調整できます。

  • 既存コードに初心者向け解説を付けたいとき
  • 構文や設計を選んだ理由の説明
  • 読み手の経験に合わせたコメント調整
github/awesome-copilot4万2026年10月24日 更新

github のスキルをすべて見る

このスキルの問題を報告する