memory-leak-resource-testing
Installation
SKILL.md
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 oomkilled