Set a memory limit that prevents OOMKills while leaving headroom for spikes.
Unlike CPU, memory is not compressible — a container that exceeds its memory limit is immediately OOMKilled by the kernel, not throttled. This calculator derives the limit from the memory request scaled by a ratio, then checks whether historically observed peak usage would breach that limit, since a ratio that looks safe on paper can still leave you exposed if peaks are underestimated.
memoryLimit = memoryRequest × ratio
Memory can't be reclaimed the way CPU time can be rationed — once a process exceeds its cgroup memory limit, the kernel's OOM killer terminates it immediately to protect the node, causing a pod restart.
1.0 (request equals limit, Guaranteed QoS) is safest for avoiding surprise OOMKills. Ratios of 1.2–1.5× add some slack for transient spikes but should be validated against real peak usage data.
Either raise the memory limit (and likely the request) to sit above observed peaks with margin, or investigate whether the peak reflects a memory leak that should be fixed rather than accommodated.