Why Your Code Crashes (Stack vs Heap)

Опубликовано: 16 Март 2026
на канале: LearnThatStack
9,385
562

Ever passed a list to a function and it changed without you touching it? That's not a bug — that's how memory works.

In this video, I break down the two regions of memory: the stack and the heap. You'll learn why stack overflows happen, how memory leaks occur even with garbage collection, and why your data sometimes mutates unexpectedly.

This isn't abstract theory — these are the concepts that explain real bugs you've probably encountered.

What you'll learn:
How the stack works
Why stack overflows happen
What the heap
Pass by value vs pass by reference
Memory leaks in garbage-collected languages

Timestamps:
0:00 - The mystery: your data changed
0:28 - Chapter 1: The Stack
1:45 - Stack Overflow — Both Causes
2:24 - Chapter 2: The Heap
3:27 - Pass by Value vs Reference
4:04 - Memory Leaks (even with GC)
4:56 - Recap & Mental Model
5:24 - Actionable Takeaway

More Videos :
Software Egineering Basics -    • Software Engineering Basics  
Software Design -    • Software Design  

#programming #coding #developer #computerscience #memory #tutorial