Golang memory footprint
summary
Shows concrete numbers and techniques: Go slice headers are 24-byte slice header overhead separate from payload, benchmarks report real allocation while unsafe.Sizeof does not, slice growth shrinks from doubling to ~125% for large capacities, maps use buckets of 8 and trigger resize at a load factor 6.5, buffered channels round allocations to heap-size classes (capacity 100 → 896 bytes, 101 → 1024), GOGC default 100 and ballast reduces GC work, avoid interface-induced heap escapes, and use pprof to find and fix hot allocations.
AI-written summary · about
chapters (9)
- 0:00Introduction to Memory
- 1:56Measuring Memory Usage
- 4:23Data Structures Overhead
- 5:28Deep Dive into Types
- 10:52Resizing Mechanics
- 17:05Structure Alignment
- 21:11Heap and Stack Allocation
- 25:16Garbage Collection Optimization
- 33:31Profiling and Conclusion








