Agent skill · data analytics · steipete

openclaw-test-heap-leaks

Investigate OpenClaw pnpm test memory growth, Vitest OOMs, RSS spikes, and heap snapshot deltas.

Why this skill is useful

Provides specific commands and workflows for diagnosing and fixing memory leaks in OpenClaw tests that the AI wouldn't reliably generate on its own.

What it needs

Requires pnpm installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 385,400 stars on the source repository.

What this skill does

OpenClaw Test Heap Leaks Use this skill for test-memory investigations. Do not guess from RSS alone when heap snapshots are available. Treat snapshot-name deltas as triage evidence, not proof, until retainers or dominators support the call. Read ../openclaw-test-performance/SKILL.md first for the current test-performance commands and proof routing. For runtime fixes (e.g., closure leaks in long-running services like the gateway), see Validating runtime fixes below — that uses a dedicated harness rather than the unit-test profiling workflow. Workflow 1. Reproduce the failing shape first. Match the real entrypoint and worker budget. For a broad unit-fast baseline with per-config max RSS and top-file timing, start with: For a suspected file, rerun that file with one worker and collect wall/RSS evidence: /usr/bin/time -l pnpm test <file> --maxWorkers=1 --reporter=verbose. Current pnpm test execution is planned by scripts/test-projects.mts. Record the printed Vitest config or shard and preserve that shape when the report is configuration- or worker-budget-specific. 2. Collect the strongest available heap evidence. Run pnpm test:perf:profile:runner -- --output-dir .artifacts/test-perf/vitest-runner-profile -- <file> for a CPU profile plus a sampling heap profile of the unit runner. Open the heap profile in DevTools and inspect the largest allocation families. Sampling .heapprofile output is not a .heapsnapshot; do not pass it to the snapshot delta helper. When a dedicated harness or another known producer emits repeated .heapsnapshot files, compare snapshots from the same PID with .agents/skills/openclaw-test-heap-leaks/scripts/heapsnapshot-delta.mjs. If no snapshot or heap profile is available, RSS growth is useful triage evidence, but keep the leak classification inconclusive. 3. Classify the growth before choosing a fix. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills steipete/openclaw-test-heap-leaks

View the source on GitHub

Browse the @skills marketplace