Tuning GOMEMLIMIT in Memory-Constrained Linux Containers
Using soft memory limits alongside GOGC to eliminate OOM kills without sacrificing p99 latency.
Since Go 1.19, pairing GOMEMLIMIT set to ~85% of the cgroup limit with a relaxed GOGC prevents sudden heap spikes from triggering the kernel OOM killer while reducing GC frequency during steady-state traffic.