ns-memory-spike-analysis

Diagnoses Node.js memory leaks and heap spikes using N|Solid heap sampling and snapshots.

6|7|Updated Jun 4, 2026
One-click install
npx skills add https://github.com/nodesource/nsolid-plugin --skill ns-memory-spike-analysis-nodesource
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ns-memory-spike-analysis
Source: https://github.com/nodesource/nsolid-plugin/tree/main/skills/ns-memory-spike-analysis
Command: npx skills add https://github.com/nodesource/nsolid-plugin --skill ns-memory-spike-analysis-nodesource

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Node.js applications suffering from memory leaks, heap growth, high RSS, or out-of-memory crashes are hard to root-cause without structured heap evidence. This Skill guides the AI through a disciplined triage workflow that reuses existing heap assets, captures new heap sampling or snapshot data only when needed, and pinpoints the constructors or functions allocating the most memory. ## Core Features & Use Cases - Evidence-First Triage: Parses supplied asset IDs, local .heapprofile/.heapsnapshot paths, and heap summaries before triggering any new capture, avoiding redundant production overhead. - Controlled Heap Capture: Prefers low-overhead heap sampling over full heap snapshots, enforces exact blocking wait times via a bundled script, and monitors asynchronous asset summarization until ready. - Root-Cause Reporting: Identifies top allocators and retaining paths from asset summaries, downloads the full asset to .nsolid/assets/, and writes a structured markdown report on request. - Use Case: An on-call engineer receives an alert that a production Node.js service shows steadily growing RSS. The Skill locates the offending agent, captures a 30-second heap sample, summarizes it, names the leaking constructor, and saves the full heap profile for deeper inspection. ## Quick Start Ask the AI to diagnose why your Node.js app's memory keeps growing using N|Solid, providing the app name or an existing heap asset ID.

Frequently Asked Questions about ns-memory-spike-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose a Node.js memory leak with N|Solid?▼

Provide the app name or an existing heap asset ID, and the Skill queries N|Solid metrics to find the growing process, captures a heap sampling profile, and summarizes it to identify the top memory-allocating constructors. It then explains the likely root cause and recommendations.

What is the difference between heap sampling and heap snapshot in Node.js?▼

Heap sampling is a low-overhead statistical profile preferred for production diagnosis, while a heap snapshot captures the full heap state and freezes the process longer. This Skill defaults to heap sampling and only uses snapshots when explicitly requested.

Can I analyze an existing .heapsnapshot or .heapprofile file?▼

Yes. Provide the local file path or asset ID and the Skill resolves it through the N|Solid asset index and analyzes its summary directly, without capturing new data. It never reads the raw heap file into context because those files are large.

Why does heap snapshot analysis take so long to return results?▼

Snapshot summarization is asynchronous and may return HTTP 202 on the first request. The Skill waits with its bundled wait script, checks assets-in-progress, and retries asset-summary until the summary is ready rather than estimating timing.

What credentials are needed to download N|Solid assets?▼

The fetch-asset.cjs script reads the console URL and service token from ~/.agents/.nodesource-auth.json, created by authenticating with your NodeSource account. It validates the console URL over HTTPS and blocks private or local addresses before downloading.