X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FCGroup.pm;fp=src%2FPVE%2FCGroup.pm;h=21681b88a8626bc785f885ae8499362ce5518c46;hp=f82cbb97c7cee9217c6b607f1b5e65726fc58051;hb=61f1cb1a921a04e2a865817d8f424b69efcaf552;hpb=228ab4b40881cbad1fe23d0c8e22c31daa80d6de diff --git a/src/PVE/CGroup.pm b/src/PVE/CGroup.pm index f82cbb9..21681b8 100644 --- a/src/PVE/CGroup.pm +++ b/src/PVE/CGroup.pm @@ -341,13 +341,11 @@ sub get_memory_stat { } elsif ($ver == 2) { my $mem = file_get_contents("$path/memory.current"); my $swap = file_get_contents("$path/memory.swap.current"); + my $stat = parse_flat_keyed_file(file_get_contents("$path/memory.stat")); chomp ($mem, $swap); - # FIXME: For the cgv1 equivalent of `total_cache` we may need to sum up - # the values in `memory.stat`... - - $res->{mem} = $mem; + $res->{mem} = $mem - $stat->{file}; $res->{swap} = $swap; } elsif ($ver == 1) { # cgroupv1 environment: