New: Cookbooks and AI ExplanationsStep-by-Step recipes to solve problems connected to Roadmaps and Cheat Sheets. Need more details? Use AI buttons for structured and simple explanations with concrete examples throughout the whole platform.Take a look
Memory keeps climbing in a service that's been running for days, and restarting it is starting to feel like the actual fix.
What you'll have at the end
Two compared heap snapshots pointing at one specific object that's never getting freed
You need
A long running Node service whose memory keeps climbing, plus a local copy of it you can restart and send the same kind of workload that made memory grow in the first place.
Not covered
Chasing a leak that lives in native memory or in a Buffer sitting outside the tracked heap, since a heap snapshot only shows what the language runtime itself is holding onto.
Shut a server down cleanly on a stop signal
for wiring a graceful-shutdown listener once, at startup; this recipe assumes that pattern already exists somewhere and traces a copy of it that got attached per job instead.
Debug a running Node process with breakpoints and the inspector
for the general mechanics of attaching an inspector session to a running process, if that route fits better than calling the snapshot function from inside your own code.
Checked 25 Aug 2026
Part of the Node.js cookbook