Standard container environments suffer from non-deterministic behavior during memory contention. When free memory drops, the Linux kernel invokes page reclamation, halting user threads for tens of milliseconds. In an automotive software-defined vehicle, this delay can cause a camera frame drop or steer-by-wire deadline violation. This article explores how cgroups v2 eliminates these latency spikes.
Instead of allowing a non-critical pod to suddenly hit `memory.max` and abruptly crash, cgroups v2 provides `memory.high`. When a pod exceeds `memory.high`, the kernel proactively throttles its allocation speed by injecting millisecond delays proportional to the overage, while PSI alerts the orchestrator to gracefully shed optional background services.
Critical safety pods must never experience kernel memory reclamation. Automotive orchestrators configure `memory.min` protection on ASIL-D cgroups, guaranteeing an untouchable pool of locked physical RAM. Even if untrusted third-party apps attempt to exhaust system memory, the kernel refuses to scan, swap, or reclaim memory pages belonging to safety-critical pods.