Why Your Code Crashes (Stack vs Heap)
Skills:
Algorithm Basics80%
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 - https://www.youtube.com/playlist?list=PLWP-VtjCVpWyLNBm3zz_sGyC5mVwiAOvj
Software Design - https://www.youtube.com/playlist?list=PLWP-VtjCVpWx7kPq30XRN6O6LjVQ4VL95
#programming #coding #developer #computerscience #memory #tutorial
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
More on: Algorithm Basics
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
I Didn’t Believe Free AI Tools Could Replace Paid Software… Until This Happened
Medium · ChatGPT
Where Did the Tokens Go?
Medium · AI
Most AI Tools in 2026 Are Overcomplicated — Here’s What Actually Seems Useful
Medium · AI
When to Make an AI Skill, When Not To, and How to Steal One from Your Own Chat
Medium · AI
Chapters (8)
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
🎓
Tutor Explanation
DeepCamp AI