[pve-devel] [PATCH container] fix #1226: show the right amount of memory usage

Dominik Csapak d.csapak at proxmox.com
Thu Dec 15 12:49:37 CET 2016


we moved the lxc cgroup settings in a sub namespace, but did not use the
total_cache value for subtracting so we showed a wrong used amount

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/PVE/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm
index 810fae5..0dcfbdf 100644
--- a/src/PVE/LXC.pm
+++ b/src/PVE/LXC.pm
@@ -197,7 +197,7 @@ sub vmstatus {
 	my $memory_stat = read_cgroup_list('memory', $vmid, 'memory.stat');
 	my $mem_usage_in_bytes = read_cgroup_value('memory', $vmid, 'memory.usage_in_bytes');
 
-	$d->{mem} = $mem_usage_in_bytes - $memory_stat->{cache};
+	$d->{mem} = $mem_usage_in_bytes - $memory_stat->{total_cache};
 	$d->{swap} = read_cgroup_value('memory', $vmid, 'memory.memsw.usage_in_bytes') - $mem_usage_in_bytes;
 
 	my $blkio_bytes = read_cgroup_value('blkio', $vmid, 'blkio.throttle.io_service_bytes', 1);
-- 
2.1.4





More information about the pve-devel mailing list