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

memory-leak-debugging

JavaScriptやNode.jsのメモリ使用量が増える原因を、ヒープスナップショットの比較や保持経路の調査から特定し、修正を支援します。

原文原文の説明を見る

Diagnoses and resolves memory leaks in JavaScript/Node.js applications. Use when a user reports high memory usage, OOM errors, or wants to capture, compare, or inspect heap snapshots with Chrome DevTools MCP memory tools.

asgeirtj/system_prompts_leaksスター 70,416(GitHub 70,416 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • Webアプリのメモリ増加を調べたいとき
  • Node.jsのメモリ不足エラーを調査したいとき
  • 操作前後のヒープを比較したいとき
  • イベントリスナーやクロージャの保持を調べたいとき

日本語での紹介

できること

JavaScriptやNode.jsのアプリで、メモリ使用量が増え続ける原因を調べ、修正の手がかりを整理します。Chrome DevTools MCPのメモリツールでヒープスナップショットを取得・比較し、増加したオブジェクトの種類や、参照が残っている経路を確認します。ブラウザー側かNode.js側かを切り分け、切り離されたDOM要素、解除されていないイベントリスナー、クロージャ、増え続けるキャッシュなどを調査します。調査後は読み込んだスナップショットを閉じ、MCPサーバーのメモリを解放します。

こんなときに便利

アプリのメモリ使用量が高い、操作を続けると動作が重くなる、メモリ不足エラーが出るといった問題の調査に向いています。操作前後のスナップショットを比べ、どのオブジェクトが残っているかを確かめたい場合にも使えます。

使い方の例

  • 「この画面を何度か操作するとメモリが増える原因を調べて」
  • 「ヒープスナップショットを比較して、増えたオブジェクトを特定して」
  • 「Node.jsで発生するメモリ不足の原因を調査して」

注意点

詳細なスナップショット比較ツールには、Chrome DevTools MCPサーバーの--memoryDebuggingフラグが必要です。

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

資料チェック

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

安全面送信・削除・コマンド実行などの扱いが明示されているか
A良好DOM要素をnullにする前にユーザーへ確認し、調査後にスナップショットを閉じます。
導入のしやすさ必要なツールや API キーが少ないか、書かれているか
B一部不足Chrome DevTools MCPが前提で、詳細ツールには起動フラグが必要です。

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

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

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

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

含まれるファイル(2)

  • SKILL.md4.2 KB
  • references/common-leaks.md1.8 KB

SKILL.md(原文)

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

Memory Leak Debugging

This skill provides expert guidance and workflows for finding, diagnosing, and fixing memory leaks in JavaScript and Node.js applications using Chrome DevTools MCP tools.

Prerequisites

Advanced memory debugging tools (compare_heapsnapshots, get_heapsnapshot_details, etc.) are only available when the server is started with the --memoryDebugging flag. First check if these tools are available; if not, try to read the MCP configuration file to check if --memoryDebugging is enabled.

Core Principles

  • Prefer MCP memory tools: Do NOT attempt to read raw .heapsnapshot files directly, as they are extremely large and will consume too many tokens. Use the Chrome DevTools MCP heap snapshot tools to summarize, compare, and inspect snapshots.
  • Isolate the Leak: Determine if the leak is in the browser (client-side) or Node.js (server-side).
  • Common Culprits: Look for detached DOM nodes, unhandled closures, global variables, event listeners not being removed, and caches growing unbounded. Note: Detached DOM nodes are sometimes intentional caches; always ask the user before nulling them.
  • Close Loaded Snapshots: Heap snapshots can be large. After completing an investigation, use close_heapsnapshot for each loaded snapshot to release memory held by the MCP server.

Workflows

1. Capturing Snapshots

When investigating a frontend web application memory leak, utilize the chrome-devtools-mcp tools to interact with the application and take snapshots.

  • Use page-scoped tools like click, navigate_page, fill, etc. (specifying pageId) to manipulate the page into the desired state.
  • Revert the page back to the original state after interactions to see if memory is released.
  • Repeat the same user interactions 10 times to amplify the leak.
  • Use take_heapsnapshot (with pageId) to save .heapsnapshot files to disk at baseline, target (after actions), and final (after reverting actions) states.

2. Comparing Snapshots

Once you have generated .heapsnapshot files using take_heapsnapshot, compare them with Chrome DevTools MCP memory tools.

  • Start with get_heapsnapshot_summary for each snapshot to confirm that the files load and to compare high-level totals.
  • Use compare_heapsnapshots to compare baseline and target snapshots. Start without classIndex for the summary diff, then request detailed class diffs only for suspicious growth by specifying classIndex.
  • Use the summary output from compare_heapsnapshots before drilling into specific node IDs.

3. Inspecting Retainers and Dominator Chains

When a class or object type grows unexpectedly, inspect the retaining chain and dominators with the MCP tools before changing code.

  • Use get_heapsnapshot_class_nodes to list instances of the suspicious class.
  • Use get_heapsnapshot_retainers, get_heapsnapshot_retaining_paths, get_heapsnapshot_dominators, and get_heapsnapshot_edges to understand why representative nodes are still reachable.
  • Use get_heapsnapshot_object_details with a specific nodeId to retrieve detailed object metadata (size, type, distance, and DOM detachedness).
  • Use get_heapsnapshot_duplicate_strings when string growth dominates the diff.
  • Read references/common-leaks.md for examples of common memory leaks and how to fix them after the retaining path points at application code.

4. Advanced Analysis and Categorized Filters

Use built-in MCP memory tools and filters to pinpoint specific leak categories directly without external tools.

  • Use get_heapsnapshot_details or get_heapsnapshot_class_nodes with filterName to target common leak causes:
    • objectsRetainedByDetachedDomNodes: Identifies detached DOM elements retained in memory.
    • objectsRetainedByEventHandlers: Identifies objects kept alive by unremoved event listeners.
    • objectsRetainedByContexts: Identifies objects trapped in closures or execution contexts.
    • objectsRetainedByConsole: Identifies objects retained by console logging.

レビュー

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

コメント

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

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

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

0 / 1000 文字

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

同じリポジトリのスキル

3d-object

無料概要あり

立体物をthree.jsで作成し、あらゆる角度から確認できるビューアーに表示します。OBJ + MTLやGLBで保存し、他の3D制作ソフトへ持ち込めます。

  • 立体物を作って全方向から確認したいとき
  • Blenderで編集するモデルの作成
  • シルエットや素材の見え方の確認
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

a11y-debugging

無料概要あり

Chrome DevTools MCPでWebページのアクセシビリティを監査し、見出し構造、ラベル、キーボード操作、フォーカス、タップ領域、色のコントラストに関する問題を調べます。

  • ページ全体のアクセシビリティを監査したいとき
  • フォームのラベルや画像の代替テキストを確認したいとき
  • キーボード操作とフォーカスを点検したいとき
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

action-items

無料概要あり

個人用のタスク一覧に、やることや期限、返答待ち、作業が止まる理由を記録します。進捗や依存関係を更新し、重複や完了済みの項目も整理するスキルです。

  • 期限付きのタスクや約束の記録
  • 返答待ちや作業が止まる理由の整理
  • 前提タスク完了後の依存関係の更新
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

agents

無料概要あり

作業の目標と完了条件を整理し、必要に応じて複数のエージェントへ分担します。進捗報告、成果の検証、PRのマージまで、プロジェクトとして進行を管理します。

  • 独立した作業を並行して進めたいとき
  • 進行中の各作業の状況確認
  • 中断したプロジェクトの再開
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

agy-customizations

無料概要あり

Antigravityのカスタマイズの種類や読み込み順、検出場所を説明し、スキル、ルール、プラグイン、フック、MCPサーバーの作成方法を案内します。

  • カスタマイズの種類を選びたいとき
  • 読み込み場所や優先順位を確認したいとき
  • スキルやルールを作成したいとき
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

animated-video

無料概要あり

再生・一時停止や時間位置の指定ができるアニメーションをHTMLページとして制作します。場面の長さや速度を調整し、横長・縦長の動画書き出しに備えます。

  • 製品の操作紹介を動画にしたいとき
  • 文字と図形で内容を説明したいとき
  • 縦長のアニメーション制作
asgeirtj/system_prompts_leaks7万2026年10月29日 更新

asgeirtj のスキルをすべて見る

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