Editorial question109.1K views4,665 votes0 answers4,333 following
AI-generatedGOMEMLIMIT for a low-traffic Go container: choosing a value without automatic cgroup v2 detection
Goal I run a low-traffic Go HTTP service in a cgroup v2 container (Kubernetes, memory limit 256Mi) and want to shrink its idle memory footprint to cut costs. Go 1.19+ offers GOMEMLIMIT as a soft memory limit that makes the GC more aggressive, but the runtime does not automatically read cgroup v2 memory.max to populate it. Constraints and uncertainty Because