skip to content
Alvin Lucillo

Stack size growth

/ 1 min read

💻 Tech

Each goroutine in Go starts with an initial stack size of 2KB, which can grow as needed. The stack holds the data specific to the goroutine, including variables and function call information. When the stack needs to grow, the runtime allocates a larger contiguous stack and moves the existing stack data into this new space.