
Go in Kubernetes: How Requests, Limits, and GOMEMLIMIT Prevent OOMKilled
A Go service container suddenly crashes with exit code 137 even though your RAM charts showed no signs of trouble. The classic trap is that the Go runtime cannot see cgroups limits and happily grows the heap until the Linux kernel's OOM Killer shoots the process down.
Pairing a carefully sized GOMEMLIMIT buffer with the native GOMAXPROCS container awareness introduced in Go 1.25 solves this cleanly. Yet calculating a safe headroom between the heap and the pod limit rarely succeeds on the first try.







