memory-leak-resource-testing
Skill1 starsChanged 53 days agoMITView on GitHub
Use when diagnosing or preventing memory leaks, unbounded growth, file-descriptor/connection/thread leaks, GC pressure, OOM kills, and slow degradation in long-running services, browsers, and mobile apps — heap snapshots, profilers, soak tests.
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 42crunch-api-security-testingSkill
- a-b-testingSkill
- acceptance-testingSkill
- accessibility-testingSkill
- ai-agent-evaluationSkill
- ai-code-securitySkill
- ai-ml-testingSkill
- analytics-tracking-testingSkill
- api-testingSkill
- authn-authz-testingSkill
- autonomous-qa-orchestrationSkill
- bdd-gherkin-testingSkill
- blockchain-smart-contract-testingSkill
- bug-reportingSkill
- chaos-resilience-testingSkill
- chatbot-voice-agent-testingSkill
- cicd-testingSkill
- cli-testingSkill
- cloud-infrastructure-testingSkill
- code-coverage-analysisSkill
- compatibility-testingSkill
- compliance-testingSkill
- concurrency-race-condition-testingSkill
- configuration-feature-flag-testingSkill
- contract-testingSkill
- cross-browser-testingSkill
- database-testingSkill
- data-migration-testingSkill
- data-pipeline-etl-testingSkill
- date-time-timezone-testingSkill
- desktop-app-testingSkill
- disaster-recovery-backup-testingSkill
- e2e-testingSkill
- email-notification-testingSkill
- event-driven-messaging-testingSkill
- exploratory-testingSkill
- flaky-test-managementSkill
- functional-testingSkill
- fuzz-testingSkill
- game-testingSkill
- graphql-testingSkill
- iac-container-security-testingSkill
- installation-upgrade-testingSkill
- integration-testingSkill
- iot-embedded-testingSkill
- llm-security-auditSkill
- llm-testingSkill
- localization-testingSkill
- manual-testingSkill
- mcp-testingSkill
- microservices-testingSkill
- mobile-testingSkill
- mutation-testingSkill
- observability-testingSkill
- payment-ecommerce-testingSkill
- performance-testingSkill
- production-monitoring-synthetic-testingSkill
- property-based-testingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Run a soak test at steady load 1–24 h (performance-testing).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Memory Leak & Resource Testing
Symptom: memory/handles/latency grow with time or request count and never plateau; ends with OOM-kill, EMFILE, or timeouts.
Detect (black-box first)
- Run a soak test at steady load 1–24 h (
performance-testing). - Chart RSS, heap-used, open FDs, thread count, DB connections, GC pause, queue depth. Healthy = sawtooth around a plateau; leak = rising baseline after each GC.
- Force GC (where possible) and compare post-GC baselines at t0 vs t+N.
# Linux / container quick checks
ls /proc/$PID/fd | wc -l # FD count over time
ps -o rss,vsz,nlwp -p $PID # RSS, VSZ, threads
lsof -p $PID | awk '{print $5}' | sort | uniq -c | sort -rn | head
kubectl top pod --containers; kubectl describe pod | grep -i oomkilledFind the owner (white-box)
| Stack | Tooling |
| Node.js | node --inspect, Chrome DevTools heap snapshots (3-snapshot diff), clinic doctor/heapprofiler, --heapsnapshot-signal=SIGUSR2 |
| Browser/SPA | DevTools Memory tab → "Allocation instrumentation on timeline", detached DOM nodes, performance.measureUserAgentSpecificMemory(); Puppeteer loop + heap check |
| Python | tracemalloc, objgraph, memray run, py-spy dump |
| Java/JVM | JFR, jcmd GC.heap_dump, Eclipse MAT dominator tree, -XX:+HeapDumpOnOutOfMemoryError |
| Go | pprof heap/goroutine profiles (/debug/pprof/heap), goroutine leak detection goleak |
| Native | Valgrind/heaptrack, ASan LeakSanitizer |
| Android/iOS | Android Studio Profiler / LeakCanary; Xcode Instruments Leaks & Allocations |
Typical root causes
Unbounded caches/maps · listeners/subscriptions never removed · timers/intervals not cleared · closures holding large objects · detached DOM nodes · unclosed streams/cursors/connections · thread/goroutine leaks (blocked channel) · growing logs/metrics label cardinality · ThreadLocal misuse · session stores without TTL.
Regression test ideas
// Jest + node: loop operation and assert bounded growth
global.gc(); const a = process.memoryUsage().heapUsed;
for (let i=0;i<10000;i++) handle(sampleReq());
global.gc(); const b = process.memoryUsage().heapUsed;
expect(b - a).toBeLessThan(5 * 1024 * 1024); // run with node --expose-gcAlso: repeat-navigation loop in Playwright then compare heap; goroutine count before/after (goleak.VerifyNone(t)); connection-pool active == 0 after test.
Report
Growth rate (MB/h), load profile, first-seen build, retained-object class + retainer path, minimal repro, suggested fix (bound/evict/close/unsubscribe).
Related
performance-testing, observability-testing, chaos-resilience-testing, mobile-testing
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

