How does Go handle stack growth for goroutines, and what are 'segmented stacks' vs. 'contiguous stacks'?

Last updated 20 June 2026

  • Goroutines start with ~2KB stacks. A function prologue check detects overflow, then the runtime allocates a larger contiguous stack, copies it and fixes pointers (stacks can also shrink).

  • Old segmented stacks linked separate chunks, causing the hot-split problem: calls at a segment boundary in a loop repeatedly allocated and freed segments.

  • Contiguous stacks (since Go 1.3) eliminate hot-split, at the cost of an amortized, predictable copy on growth.

  • https://www.reddit.com/r/rust/comments/1h15md8/goodbye_rust_i_wish_you_success_but_im_back_to_c/
  • https://www.reddit.com/r/golang/comments/1gfjnzm/since_when_is_senior_golang_developer_expected_to/
All Golang interview questions