TLDR Web Dev · ARTICLES & TUTORIALS

THE PROCESS THAT KEPT DYING

lukedeniston.com9 min read

Summary from the TLDR Web Dev newsletter

This article recounts the author's experience debugging a memory leak in a Node.js application. The story began with intermittent "502 Bad Gateway" errors on a crowdfunding website, leading the author to suspect PM2, a process manager, as the culprit. After ruling out PM2, the investigation focused on a memory leak within the Next.js application. The author used tools like Chrome DevTools to take heap snapshots and identified Moment.js as the source of the leak. It simply needed to be upgraded to fix the leak.