Video series · 2 parts
How Go decides whether data lives on the stack or the heap, and how its garbage collector manages and is tuned for heap memory.
Go has a garbage collector, so you rarely think about memory, but knowing where your data lives helps you write faster programs. Part 1 covers the stack and the heap, and how the compiler's escape analysis decides which one each variable goes on.
Part 2 is about the garbage collector itself. It marks and sweeps concurrently while your program runs, and it doesn't split the heap into generations. I explain why: the compiler already keeps most short-lived values on the stack, so generations would buy Go very little.

Go runs a garbage collector, but underneath that every variable ends up either on the stack or the heap, and the compiler chooses using escape analysis.

I break down how Go’s garbage collector works: it’s non-generational, concurrent, and uses a tricolor mark-and-sweep algorithm.


Dude, you’re at the bottom of my landing page.
Just book a call already if you’re that interested.
You scrolled all the way here.