]> git.proxmox.com Git - pve-container.git/commit
vmstatus: fix memory usage value including cache sizes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 18 Oct 2016 13:35:14 +0000 (15:35 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Fri, 21 Oct 2016 13:28:20 +0000 (15:28 +0200)
commitb3059d3569616523039c4e65b6bc2079f0734771
treed759fcba56e30ea2908b243a5b1027d31096dfd0
parent74e20aebd0b8060ec7110ccf7a730506295744eb
vmstatus: fix memory usage value including cache sizes

The cgroup value memory.usage_in_bytes includes the memory used by
file buffers and other caches, resolve this by getting the cache
value from the memory.stat file and substract it from
memory.usage_in_bytes when calculating the current memory usage of
the CT.
This results in the same value as a `free` call from the container
does (when not including the buffered data), at least with a free
version which uses data from /proc and not the sysinfo() syscall.

Addresses partly the bug #1139

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
CC: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/LXC.pm