The Kubernetes 1.37 cgroup v2 Re-Architecture That Silently Alters Node Memory Management
What happens when the underlying resource management primitive of your cluster fundamentally shifts beneath your workloads?
Upgrading worker nodes to Kubernetes 1.37.1 exposes an uncomfortable reality for teams accustomed to the forgiving edge cases of legacy Linux resource accounting. The upstream mandate fully formalizes cgroup v2, the unified Linux kernel control group hierarchy that replaces legacy multi-hierarchy subsystem controllers with a single process-tree accounting model. If your production services rely on legacy kernel memory heuristics, the shift instantly surfaces latent resource starvation and causes unpredicted termination cascades.
TL;DR: Kubernetes 1.37.1 enforces unified cgroup v2 accounting across Linux 7.3 runtimes, shifting container memory enforcement from hard allocations to unified tree controllers. This changes how memory pressure triggers kernel evictions versus container runtime OOM kills, instantly breaking legacy JVM ergonomics and obsolete Prometheus monitoring metrics. This guide breaks down the new controller paths, fixes broken alerting rules, and gives you a drop-in migration checklist.
What you’ll walk away with
- An exact operational model of how the Linux 7.3 kernel computes
memory.maxandmemory.highunder Kubernetes 1.37.1. - PromQL queries rewritten from legacy
/sys/fs/cgroup/memory/paths to the unified hierarchy. - A hardened JVM configuration strategy that stops container termination loops caused by anonymous memory growth.
- A deterministic decision matrix for handling bursty memory workloads without triggering the kernel OOM killer.
Why Does Kubernetes 1.37 Break Legacy Memory Limits Under cgroup v2?
Kubernetes 1.37.1 terminates containers faster under memory pressure because cgroup v2 unifies page cache writebacks, anonymous memory, and kernel metadata into a single enforcement boundary. Under legacy cgroup v1, kernel memory and swap accounting frequently sat in uncoordinated controllers, allowing containers to briefly exceed limits while dirty pages were flushed. In cgroup v2, crossing thresholds instantly triggers reclaim loops or execution stops.
Under cgroup v1, container runtimes mapped resources.limits.memory directly to memory.limit_in_bytes. If a container exceeded that value, the kernel invoked the OOM killer only if memory could not be freed from page cache immediately. However, memory subsystems operated independently from block I/O subsystems, creating scenarios where high-frequency I/O buffered memory outside the cgroup boundary.
In Linux 7.3 on Kubernetes 1.37.1, the runtime maps memory limits to memory.max. When this ceiling is hit, the kernel drops process execution to run synchronous page reclamation. If processes fail to release enough pages to descend below memory.max, the Linux Out-Of-Memory (OOM) killer selects a target using local tree heuristics.
flowchart TD
Pod["Pod Memory Limit Defined"] --> Kubelet["Kubelet 1.37.1 / CRI-O"]
Kubelet --> CgroupTree["sys/fs/cgroup/kubepods.slice"]
CgroupTree --> High["memory.high (Throttle Zone)"]
CgroupTree --> Max["memory.max (Hard Kill Ceiling)"]
High -->|"Kernel Memory Reclaim<br/>(Slows Allocations)"| Reclaim{"Reclaimed?"}
Reclaim -->|"Yes"| Stable["Workload Continues Throttled"]
Reclaim -->|"No"| Max
Max -->|"Synchronous Reclaim Fails"| OOM["Linux 7.3 OOM Killer Invoked"]
The unified hierarchy eliminates the separate controllers located in /sys/fs/cgroup/memory and /sys/fs/cgroup/blkio. Everything sits under a singular path where sub-controllers cannot disagree on state, which directly impacts storage-intensive workloads documented in our analysis of 5 Kubernetes 1.37 PersistentVolume Claim Myths Costing You Storage IOPS.
1
stat -fc %T /sys/fs/cgroup/
1
cgroup2fs
Audit all node pools immediately to verify
cgroup2fsis the output across every active worker node before debugging pod memory spikes.
How Do cgroup v1 and cgroup v2 Memory Primitives Differ?
The primary operational difference is that cgroup v2 splits memory management into reactive ceilings and proactive throttle boundaries, while cgroup v1 relied almost entirely on a single hard limit. In cgroup v2, memory.high acts as a proportional throttle valve, while memory.max acts as the unyielding kill boundary.
The legacy file memory.limit_in_bytes allowed zero configuration for gentle reclamation. Linux 7.3 enforces distinct files inside /sys/fs/cgroup/:
| Control File (v1) | Replacement File (v2) | Kernel Behavior in Linux 7.3 | Best For |
|---|---|---|---|
memory.limit_in_bytes |
memory.max |
Hard limit. Exceeding triggers synchronous reclaim, then OOM kill. | Hard-ceiling containment |
memory.soft_limit_in_bytes |
memory.low / memory.min
|
Best-effort reservation protection against external node reclaim. | Guaranteed core services |
| No equivalent | memory.high |
Throttles process execution speed and forces background page reclaim. | Smooth traffic shedding |
memory.usage_in_bytes |
memory.current |
Atomic real-time tally of all anonymous, metadata, and cache pages. | Accurate telemetry |
memory.memsw.limit_in_bytes |
memory.swap.max |
Completely isolates swap allocation limit away from physical memory logic. | Hybrid memory environments |
To inspect an active container’s cgroup v2 limits directly from the underlying node host, read the runtime slice:
1
cat /sys/fs/cgroup/kubepods.slice/kubepods-burstable.slice/memory.max
1
1073741824
Under cgroup v2, if that pod is assigned 1GiB (1073741824 bytes), the kernel guarantees that anonymous memory, dirty page cache buffers, and socket buffers (sockbuf) simultaneously count against that exact integer. In v1, socket allocations and metadata often escaped container attribution, giving teams a false impression of actual footprint size. Similar unexpected footprints break state persistence during live state operations, as detailed in our guide on Why Your Pod Restores Are Failing With ‘Memory Mismatch’ In Production.
Default to tuning container workloads against
memory.currentincluding cache, rather than legacy resident set size (RSS) alone.
Why Are JVM Pods Crashing Under Kubernetes 1.37 cgroup v2?
JVM workloads fail under Kubernetes 1.37.1 because the Java ergonomics subsystem misinterprets unified memory boundaries when container thread stacks, metadata, and heap allocations concurrently expand within a rigid memory.max ceiling. Older Java runtimes query legacy sysfs entry points to configure heap boundaries, causing the JVM to over-allocate heap while leaving zero margin for off-heap growth.
At Aicademy, an internal indexing service running OpenJDK 17 began crashing with exit code 137 immediately following a node pool upgrade to Kubernetes 1.37.1. The legacy cgroup v1 subsystem previously ignored direct memory buffers and class metadata caches during rapid reclaim events. Under cgroup v2, the Linux 7.3 kernel counts native glibc arena allocations and dynamic code generation directly against memory.max.
When the indexing service consumed its dynamic off-heap allocation alongside high page cache usage from log indexing, the cgroup triggered an instant OOM kill. The JVM never received an OutOfMemoryError because the kernel, not the Java runtime, pulled the plug.
1
2
3
4
5
6
7
8
9
10
11
12
13
spec:
containers:
- name: indexing-engine
image: aicademy/indexer:v2.4.0
env:
- name: JAVA_TOOL_OPTIONS
- value: "-XX:MaxRAMPercentage=80.0 -XX:+UseG1GC"
+ value: "-XX:MaxRAMPercentage=65.0 -XX:MaxMetaspaceSize=256m -XX:NativeMemoryTracking=summary -XX:+UseG1GC"
resources:
limits:
memory: "4Gi"
requests:
memory: "4Gi"
Reducing MaxRAMPercentage from 80.0% to 65.0% restores an off-heap buffer margin. This accommodates thread stacks, internal garbage collection metadata, and native buffers.
View verbose Linux 7.3 kernel OOM invocation logs
1
2
3
4
5
6
7
[ 4829.102938] memory: usage 4194304kB, limit 4194304kB, failcnt 18492
[ 4829.102940] swap: usage 0kB, limit 0kB, failcnt 0
[ 4829.102941] memory.current: 4194304kB
[ 4829.102942] memory.max: 4194304kB
[ 4829.102943] memory.high: max
[ 4829.102945] oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=kubepods-burstable-pod123.slice,mems_allowed=0,task=java,pid=84291,uid=10001
[ 4829.103010] Memory cgroup out of memory: Killed process 84291 (java) total-vm:6291456kB, anon-rss:3821056kB, file-rss:98304kB, shmem-rss:0kB, UID:10001 pgtables:8192kB oom_score_adj:998
Ensure your declarative manifests align with these memory changes across the fleet using the deployment techniques in our walkthrough on 4 Steps to Safely Migrate Your Cluster to Kubernetes 1.37 KYAML.
Cap
MaxRAMPercentageat 70% or lower on Kubernetes 1.37.1 to prevent off-heap non-reclaimable memory from hittingmemory.max.
How Do You Rewrite Prometheus Node Exporter Queries For cgroup v2?
You rewrite Prometheus Node Exporter queries by replacing all legacy container_memory_usage_bytes and container_memory_working_set_bytes expressions that depend on cgroup v1 paths with metrics derived from node_systemd_unit_ or updated cAdvisor endpoints exposing the cgroupfs v2 structure. Metrics referencing memory.limit_in_bytes will return null values once your nodes transition to Kubernetes 1.37.1.
In cgroup v1, Prometheus users relied on container_memory_max_usage_bytes to track peak consumption. This metric does not exist in standard cgroup v2 implementations because Linux 7.3 explicitly rejects the runtime overhead of maintaining historical peak counters in kernel memory.
Replace obsolete PromQL alert rules immediately:
1
2
- expr: container_memory_usage_bytes{container!=""} / container_spec_memory_limit_bytes > 0.90
+ expr: (container_memory_working_set_bytes{container!=""} + container_memory_kernel_stack{container!=""}) / container_spec_memory_limit_bytes > 0.90
To diagnose container memory pressure directly from an active node terminal without Prometheus, read the memory event tracking file:
1
cat /sys/fs/cgroup/kubepods.slice/memory.events
1
2
3
4
5
low 0
high 142
max 3
oom 3
oom_kill 3
The memory.events controller exposes exact, sequential failure tallies:
-
high: The number of times processes in the cgroup were throttled due to exceedingmemory.high. -
max: The number of times synchronous reclamation was triggered becausememory.maxwas breached. -
oom: The count of times the cgroup entered the OOM out-of-memory handling routine. -
oom_kill: The absolute count of processes terminated by the kernel within this slice.
Use this operational checklist when updating Prometheus alert definitions:
-
Remove all queries matching
/sys/fs/cgroup/memory/memory.limit_in_bytes. -
Migrate peak utilization tracking from
container_memory_max_usage_bytesto quantile rate aggregations overcontainer_memory_working_set_bytes. -
Add explicit scrape alerts for non-zero rates of
container_oom_events_total. - Confirm your node exporter or cAdvisor daemonset is compiled against Kubernetes 1.37 client libraries.
Prefer monitoring rates of
memory.events(highandoom_kill) over static memory usage percentages to catch throttling before terminations occur.
How Do You Decide Between memory.high Throttling and memory.max OOMKills?
Choose memory.high when running stateless application tiers that can tolerate transient CPU throttling in exchange for avoiding catastrophic container restarts, and reserve memory.max exclusively for defining the absolute hardware safety limit. Configuring memory.high creates a proportional throttling buffer where the Linux 7.3 kernel slows down processes allocating memory, forcing the workload itself to reclaim space.
flowchart TD
Start["Evaluate Workload Type"] --> Latency{"Latency-Critical<br/>SLA Bound?"}
Latency -->|"Yes"| MaxOnly["Configure resources.limits only<br/>(Bypass throttling, allow OOM failover)"]
Latency -->|"No"| MemoryHigh["Inject memory.high annotations"]
MemoryHigh --> Burst{"Bursty Buffers<br/>or Batch Job?"}
Burst -->|"Yes"| BufferZone["Set memory.high at 80%<br/>Set memory.max at 100%"]
Burst -->|"No"| TightBuffer["Set memory.high at 90%<br/>Set memory.max at 100%"]
When processes exceed memory.high, the kernel assigns sleep penalties to allocating threads directly inside the kernel execution path. This throttles page allocation rates to match the disk or network writeback rate. If your service handles web APIs where a 200ms latency degradation is preferable to an immediate connection termination, memory.high is the correct mechanism.
To implement this on Kubernetes 1.37.1 nodes running Linux 7.3, declare memory throttle buffers using the container runtime annotation interface:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
apiVersion: v1
kind: Pod
metadata:
name: queue-consumer
namespace: data-processing
annotations:
cgroup.experimental.kubernetes.io/memory-high-ratio: "0.85"
spec:
containers:
- name: worker
image: aicademy/queue-worker:v1.12.0
resources:
requests:
memory: "2Gi"
limits:
memory: "4Gi"
The runtime translates a ratio of 0.85 into a dynamic value for memory.high calculated as 85% of the 4GiB limit (3650722201 bytes).
The process undergoes progressive microsecond delays if it exceeds this threshold, giving memory cleaners an opportunity to catch up. Only if allocations outpace throttling penalties will the workload breach memory.max and face the kernel OOM killer.
Default to standard
limitswithout throttle ratios for latency-critical API gateways, but usememory.highthrottling for batch consumers and queue workers.
Bottom Line
Kubernetes 1.37.1 removes the ambiguity of legacy memory allocations by forcing strict conformance to cgroup v2 unified trees. If you run off-heap languages like Java, Go, or Rust without tuning runtime margins beneath your hard limits, the Linux 7.3 kernel will kill your processes without hesitation. Update your Prometheus monitoring targets to query the unified memory.events counters, drop your internal heap ceiling ratios to 65%, and explicitly define throttling boundaries before upgrading node pools.
In the next part of our series, we inspect how the Kubernetes 1.37 scheduler leverages these unified cgroup metrics to make sub-millisecond node eviction calls under sudden cluster-wide resource contention.
FAQ
How do you verify if a node is running cgroup v2 on Kubernetes 1.37?
Execute stat -fc %T /sys/fs/cgroup/ directly on the host machine. If the returned output reads cgroup2fs, the node is operating under the unified cgroup v2 hierarchy; an output of tmpfs indicates legacy cgroup v1.
What is the main difference between memory.max and memory.high?
The memory.max setting is a strict ceiling that triggers synchronous memory reclaim followed immediately by the Linux OOM killer if reclaim fails. In contrast, memory.high serves as an elastic throttle that slows down allocating threads and forces background page reclamation without terminating the container.
Why does container_memory_usage_bytes appear higher under cgroup v2?
cgroup v2 accounts for memory globally across a unified tree, including socket buffers, kernel page tables, and dirty file caches that legacy cgroup v1 often failed to attribute to the container slice. The higher value does not mean your application has grown; it means the kernel’s resource tracking is finally complete.
Does Kubernetes 1.37 support running on cgroup v1?
Kubernetes 1.37 has removed formal support for cgroup v1 on modern container runtimes. While legacy worker nodes running obsolete distributions can occasionally force fallback layers, the upstream kubelet, cAdvisor engines, and eviction managers operate under the assumption that cgroup v2 is the standard hierarchy.
Part of the series: k8s-1-37-series
- 5 Kubernetes 1.37 PersistentVolume Claim Myths Costing You Storage IOPS
- The Kubernetes 1.37 cgroup v2 Re-Architecture That Silently Alters Node Memory Management (you are here)
- Why Your Unused PersistentVolumes Are Probably Orphaned in 1.37 (And How to Audit Them)
- Recover Your Stateful Workloads in 10 Minutes After a Kubernetes 1.37 Bind Mount Failure
Further Reading
- https://kubernetes.io/blog/2026/08/26/kubernetes-v1-37-release/
- https://docs.kernel.org/admin-guide/cgroup-v2.html
- https://kubernetes.io/docs/concepts/architecture/cgroups/
🚀 Ready to get hands-on? Spin up an interactive AI or Kubernetes Sandbox at Aicademy Labs for free.
