diff --git a/.changelog/14069.txt b/.changelog/14069.txt new file mode 100644 index 000000000000..9076fc3d6b67 --- /dev/null +++ b/.changelog/14069.txt @@ -0,0 +1,3 @@ +```release-note:bug +cli: Fixed a bug where the memory usage reported by Allocation Resource Utilization is zero on systems using cgroups v2 +``` diff --git a/command/node_status.go b/command/node_status.go index a58c594e410a..bb6702125e88 100644 --- a/command/node_status.go +++ b/command/node_status.go @@ -964,7 +964,11 @@ func getActualResources(client *api.Client, runningAllocs []*api.Allocation, nod } cpu += stats.ResourceUsage.CpuStats.TotalTicks - mem += stats.ResourceUsage.MemoryStats.RSS + if stats.ResourceUsage.MemoryStats.Usage > 0 { + mem += stats.ResourceUsage.MemoryStats.Usage + } else { + mem += stats.ResourceUsage.MemoryStats.RSS + } } resources := make([]string, 2)