nodefony-check-memory-health

Runs Nodefony HTTP memory integration tests and interprets heap thresholds to detect leaks.

Updated Dec 19, 2023
One-click install
npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-check-memory-health-nodefony
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nodefony-check-memory-health
Source: https://github.com/nodefony/nodefony-core/tree/main/.claude/skills/nodefony-check-memory-health
Command: npx skills add https://github.com/nodefony/nodefony-core --skill nodefony-check-memory-health-nodefony

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Before committing changes to Nodefony's HTTP pipeline, DI container, or framework core, you need to verify they do not introduce memory leaks. This Skill runs the dedicated Vitest memory gate for @nodefony/http and, crucially, tells you how to interpret the results: which heap thresholds matter, what a breach means, and where to look for the leak. ## Core Features & Use Cases - Memory Gate Execution: Runs the memory.test.ts suite (1000 sequential GETs, 100 sync/async crashes, 100 WebSocket connections) with filtered output showing only heap deltas and failures. - Threshold Interpretation Grid: Maps each test to its critical heap limit (e.g., 1000 GETs < 35 MB, WS connections < 30 MB) and the probable leak cause when exceeded. - Blocker Protocol: Treats any threshold breach as a commit blocker and guides investigation via git diff, listener cleanup checks, and lazy allocation review. - Use Case: After modifying the request pipeline in @nodefony/framework, run this gate before committing; if the sync-crash test exceeds 10 MB, the Skill directs you to check scope cleanup in the Kernel rather than committing a regression. ## Quick Start Ask the assistant to run the Nodefony memory health check against the running server and report whether all heap thresholds pass.

Frequently Asked Questions about nodefony-check-memory-health

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

FAQPage Schema
How do I check for memory leaks in a Nodefony application?

Run the memory gate via npm run test:memory in the @nodefony/http package with a server already running on ports 5151/5152. The suite executes 1000 sequential GETs, crash scenarios, and WebSocket connections, then compares heap growth against fixed thresholds.

What heap thresholds indicate a memory leak in Nodefony HTTP tests?

Key limits are 35 MB for 1000 sequential GETs, 10 MB for 100 sync or async crashes, 30 MB for 100 WebSocket connections, and 30 MB for 200 multipart uploads. Exceeding any threshold is a blocker that must be investigated before committing.

Why does the memory test fail with ECONNREFUSED before running?

ECONNREFUSED in the before-all hook means the Nodefony server is not running or ports 5151/5152 are taken, not a heap problem. Start the server first via the start.sh script, which injects --expose-gc so the memory probe can force garbage collection.

Can I run the memory gate together with the CLI boot test suite?

No. The CLI boot suite spawns production and cluster processes on ports 5151/5152, causing port conflicts with the memory tests. Run them sequentially: the CLI suite alone first, then start the server and run the memory gate.

When should I not use the Nodefony memory test suite?

Do not use it to profile a single isolated request or measure CPU performance. For single-request analysis use node --inspect with the Chrome profiler, and for CPU benchmarking use npx clinic or a dedicated benchmark.