How to Surround Yourself with Garbage and Lose Memory
summary
A practical look at Go garbage collection and memory allocation: where Go allocates objects, how the garbage collector identifies unused memory, and which coding patterns and data types can confuse the collector and hinder efficient reclamation. The talk explains how certain usages create conditions for memory leaks and how to avoid introducing accidental retention of objects.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 3:17Stack and heap basics
- 11:24Escape analysis in Go
- 14:53Stack vs heap examples
- 15:18Garbage collector overview
- 17:29What is memory leak
- 18:34Leaks in channels
- 21:26Slice memory issues
- 27:31Fixing slice leaks
- 28:14Map memory consumption
- 35:41Go 1.24 map changes
- 37:04Memory fragmentation
- 41:59Optimization pitfalls
- 42:19Efficient Go code tips
- 43:21Q&A
