Memory peak usage broken since 4.0

# lxd --version
3.0.3
# lxc info container
...
  Memory usage:
    Memory (current): 1.89GB
    Memory (peak): 1.91GB

 # lxd --version
4.0.1
# lxc info container
...
  Memory usage:
    Memory (current): 8.32GB

The value simply seems to be set to 0 both in the API and in /sys/fs/cgroup/memory/… (which is what the API reads from I guess)

4.0.1
curl --unix-socket /var/snap/lxd/common/lxd/unix.socket s/1.0/containers/elasticsearch05/state

      "memory":{
         "usage":8311889920,
         "usage_peak":0,
         "swap_usage":0,
         "swap_usage_peak":0
      },

EDIT: I guess this is a feature of Cgroups v2?

Taking a look. Unless you switched your system to cgroup2, things should work…

1 Like