Back to Browse

Stack vs Heap Memory Explained | JS Internals #2

42 views
May 10, 2026
30:01

Understanding how JavaScript manages memory is what separates junior developers from seniors. In this video, we dive deep into the Memory Model, comparing the Stack and the Heap, and how they affect performance and bug-hunting. Watch Part 1 (JS Engine & V8): https://www.youtube.com/watch?v=m9Zj7eIQVMk&t=44s What we cover in this video: 00:00 What is Memory?: Introduction to the concept 00:37 Computers Forget: Why RAM is volatile and data is temporary 01:20 RAM Explained: Deep dive into Random Access Memory 01:44 The Stack: Definition of static memory allocation 02:15 The Call Stack: Detailed look at how JS tracks function execution 11:29 Stack Push & Pop: The mechanics of adding and removing frames 12:13 Stack Overflow: What happens when the stack runs out of space 12:45 Infinite Recursion: Why recursive calls without base cases crash the stack 16:07 Enter the Heap: Introduction to dynamic memory allocation 16:42 Objects in the Heap: Why complex data (objects/arrays) live here 17:09 Primitive Types: Storage for strings, numbers, and booleans 17:39 Primitive Copy Values: Understanding "pass by value" 20:25 The Great Divide: The visual breakdown of Stack vs. Heap 20:50 Memory References: How the Stack points to the Heap 21:20 Objects Share References: Understanding "pass by reference" 24:48 Unused Memory: Identifying data that is no longer reachable 28:11 Memory Leak Patterns: Tips for spotting leaks in event listeners and timers Connect with Visual Engineering: Subscribe for more deep dives into Software Engineering internals. #JavaScript #WebDev #SoftwareEngineering #CodingTutorial #JSInternals

Download

0 formats

No download links available.

Stack vs Heap Memory Explained | JS Internals #2 | NatokHD