Visualised guide to memory management in JavaScript
summary
Starts at hardware: RAM cells, addresses and virtual memory, then follows JavaScript values into V8 showing literal mechanisms — V8 uses a small Young generation (typically 1–8 MB), a scavenger two‑space copy collector that requires roughly double the space and yields millisecond pauses, and a major mark‑sweep‑compact collector that promotes ~20% of objects to the old generation. Covered details include string interning, pointer vs value layout, free lists and pages, concurrent marking/sweeping, compaction on the main thread, and where pauses still occur.
AI-written summary · about
chapters (8)
- 0:00Introduction and hardware
- 2:17Memory architecture
- 5:36JavaScript engine overview
- 8:21Heap and stack memory
- 12:21References and copying
- 15:50Garbage collection basics
- 20:13Advanced garbage collection
- 24:35Recap and conclusion
related talks
31mJavaScript memory management: Visual Guide
17mAlice's Adventures in Memory Management, or how JavaScript objects work
26mThe Hitchhiker's Guide to All Things Memory in Javascript
30mMemory Don't Forget To Take Out The Garbage
22mThe Hitchhiker's Guide to All Things Memory in JS
28mAlice's Adventures in Memoryland
21mMemory: Don't Forget to Take Out the Garbage
24mTrash Talk - Understanding Memory Management
