Press enter or click to view image in full size
Member-only story
Debugging a Production Memory Leak in Node.js
Follow the investigation from symptoms to heap snapshots, root cause, and a safer fix.
Muhammad Qasim
12 min readJust now
--
The service restarted at 2:17 a.m.
Nothing unusual appeared in the error logs. Request latency had increased gradually, the container had approached its memory limit, and then the process disappeared.
The orchestrator started a replacement. Memory usage dropped. Everything looked healthy again.
For a while.
By the following afternoon, the same pattern returned. Memory climbed throughout the day, garbage collection became more frequent, and eventually the container restarted again.
Increasing the memory limit would have bought us more time.…