Kars CS Notes

Engineering notes on Linux networking, storage engines, and distributed systems.

Tuning GOMEMLIMIT in Memory-Constrained Linux Containers

Published 2026-11-07 · Go

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.

← Back to Home