Understanding 5 languages memory models (or most of them)
summary
Explains concrete memory behavior for C (manual malloc/free), Rust (compile-time ownership and borrowing that inserts frees), Python (reference counting plus a cycle detector), Go (a non-moving, stop-the-world three-color mark-and-sweep collector; one stack per goroutine; slice growth doubles underlying arrays) and Java (generational GC: Eden/Survivor/Old with young-generation frequent collections and promotion). Notes Rust and Go implementation details, why pointers to stack are invalid, and the surprising fact that Swift uses reference counting rather than generational GC.
AI-written summary · about
chapters (10)
- 0:00Introduction to memory models
- 1:48Understanding stack memory
- 4:19Understanding heap memory
- 8:48Language-specific approaches
- 10:05Ownership in Rust
- 16:10Reference counting in Python
- 22:22Mark and sweep in Go
- 28:55Generational GC in Java
- 32:20Language comparison summary
- 35:18Q&A session








