Performance Intermediate By Samson Tanimawo, PhD Published Oct 18, 2026 9 min read

Memory Leaks: Finding and Fixing

Memory leaks accumulate silently; investigations are painful. Process below cuts time-to-fix substantially.

Recognizing leaks

Memory leak: memory grows without bound; eventually OOM kills the process.

Distinguishable from cache growth (caches plateau) and load growth (corresponds to traffic).

Four-symptom checklist

Heap-dump analysis

JVM: heap dump + Eclipse MAT.

Go: heap profile via pprof.

Python: tracemalloc + objgraph.

Each language has its tool; learn yours.

Safer alternatives

Continuous profiling beats incident-time heap dumps.

Per-request memory accounting (allocation sampling) flags growth in specific code paths.

Memory regressions in CI: fail PR if test process holds >X memory.

Antipatterns

What to do this week

Three moves. (1) Apply this pattern to your slowest production endpoint. (2) Measure p99 before/after. (3) Document the win and ship the runbook so the team can reproduce.