Memory Layout of V8's Heap
summary
Explains how V8 represents JS values as 64-bit machine words (8-byte words), how small integers are tagged to avoid boxing (31-bit smallints), and how maps aka hidden classes encode property offsets so property loads become fast map checks plus direct loads. Demonstrates the postmortem tool llnode with commands like v8 back-trace and v8 inspect, shows using core dumps to count instances and trace retainers, and recounts fixing a huge memory leak in the TLS core module and nodejs.
AI-written summary · about
chapters (8)
- 0:00dot JS Fedor Indutny
- 0:20Fedor Indutny Software Engineer @ PayPal Node.js TSC/CTC member
- 2:27HOW TO FIT HIGH-LEVEL DATA INTO LOW-LEVEL MEDIUM?
- 5:55SMall Integer
- 6:49Boxing
- 9:50What is it?
- 11:53Map == Hidden Class
- 14:56String properties • Number properties (elements) • In-object properties (fast properties)
related talks
31mJavaScript memory management: Visual Guide
28mMemory Profiling for Mere Mortals
27mVisualised guide to memory management in JavaScript
22mThe Hitchhiker's Guide to All Things Memory in JS
26mThe Hitchhiker's Guide to All Things Memory in Javascript
38mUnderstanding Memory Behavior on Nodejs
24mmö.js - explaining js vm in js
24mDemystifying V8 and JavaScript Performance
