Using Heap Dumps to Find and Fix Node.js Memory and CPU Problems
summary
Heap snapshots from Node (loaded into Chrome DevTools memory panel) let developers pin a leak by taking two snapshots and comparing deltas to see what only increased — one demo shows 64K object instances added and retained by a global array, causing repeated GC and a CPU GC storm at ~100%. Production options shown include the heap snapshot near-heap-limit flag and sending SIGUSR2 to trigger on-demand dumps; snapshots can crash or expose sensitive data so limit and secure them.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker intro
- 1:15Nightmare on-call scenarios
- 2:39Garbage collection limitations
- 6:55Memory graphs and leaks
- 9:22Why leaks are hard to find
- 10:47What is a heap dump
- 11:51Live leak demo setup
- 13:59Using DevTools for heap dumps
- 18:16Benefits and downsides of DevTools
- 19:42Production-friendly heap dump methods
- 23:38API-based heap dump approach
- 25:46Security and heap dump risks
- 26:50Summary and takeaways
