Demystifying Memory Leaks in JavaScript
summary
Walks through concrete diagnostics and fixes: use --inspect and --trace-gc, capture and compare heap snapshots, and read the 2.4MB delta that pinpoints leaked strings or forgotten event listeners. Demonstrates a tiny Node.js program that creates snapshots every 2s and a separate string slice retaining large buffer bug that crashes the process; shows streaming large files and closing file descriptors stops growth and that targeted fixes—rather than restarts—resolve leaks.
AI-written summary · about
chapters (6)
- 0:00Start
- 2:59Stack memory
- 5:31Mark Sweep
- 10:32Reading big data in memory
- 12:30Event listeners
- 21:33Steps to fix memory leaks
related talks
31mMemory Leaks in JavaScript
19mUnderstand, find, prevent and fix memory leaks in JavaScript
46mTracking Down a Memory Leak
35mMemory Chronicles: Manage, Trace and Fix Memory Leaks
38mUnderstanding Memory Behavior on Nodejs
20mMemory Leaks and the Havoc They Wreak
33mMemory Profiling for Mere Mortals
43mFinding memory leaks and CPU bottlenecks with Node.js debug tools
