Proxmox 1.9 Memory Usage Doesn't add up

ndew

Renowned Member
Nov 26, 2008
29
0
66
Hi,

Ok so I've created a few new 1.9 servers and migrated some virtual machines to them. Everything is working fine but I'm not sure how memory usage is calculated from the output below used + free + buffers + cached is more than the total, which is confusing me to no end, also KSM says it's sharing about 1.5 GB of memory if i did my math right, but if that's the case there should be way more free/cached then what's there. It's really confusing me.

Nick D.
Canhost.ca

Code:
xxx:~# free -m
             total       used       free     shared    buffers     cached
Mem:          3944       3674        269          0        268        415
-/+ buffers/cache:       2990        953
Swap:         4095        134       3961
xxx:~# pveversion -v
pve-manager: 1.9-24 (pve-manager/1.9/6542)
running kernel: 2.6.32-6-pve
proxmox-ve-2.6.32: 1.9-43
pve-kernel-2.6.32-6-pve: 2.6.32-43
qemu-server: 1.1-32
pve-firmware: 1.0-13
libpve-storage-perl: 1.0-19
vncterm: 0.9-2
vzctl: 3.0.28-1pve5
vzdump: 1.2-15
vzprocps: 2.0.11-2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.15.0-1
ksm-control-daemon: 1.0-6
 
I'm not sure how memory usage is calculated from the output below used + free + buffers + cached is more than the total..

Your thinking is to complicated ;-)

total = used + free
 
Last edited by a moderator:
NM it's doing the same thing, just on the new 1.9 server KSM shows this

Code:
Every 2.0s: cat /sys/kernel/mm/ksm/pages_sharing                                                                            Thu Sep 29 12:29:21 2011


425967

Which if my math is right is 1663MB of shared pages? I'm just thinking my Memory usage should be lower, i'm only showing 2463MB for all 3 VM's (as per the web interface) but the server is using 2.93GB, i know there is overhead for proxmox it self but i've never seen more then 300 MB or so, so if there are so many shared pages why is the overall memory not lower?

Nick D.
Canhost.ca

______________________

Ok, then what are buffers and cache? What do they represent? it just seems different then on previous servers.

On an old node I have running this is the output, and in the proxmox interface it shows 7.69GB used, but if it was running 1.9 it would be almost 16GB used, why the change? I'm showing increased memory usage on 1.9 but really it's not because the interface is not taking away the cached value?

Nick D.
Canhost.ca

Code:
xxx:~# free -m
             total       used       free     shared    buffers     cached
Mem:         16036      15810        226          0        400       7553
-/+ buffers/cache:       7855       8180
Swap:        15359         11      15348
xxx:~# pveversion -v
pve-manager: 1.6-2 (pve-manager/1.6/5087)
running kernel: 2.6.24-12-pve
proxmox-ve-2.6.24: 1.6-25
pve-kernel-2.6.24-7-pve: 2.6.24-11
pve-kernel-2.6.24-12-pve: 2.6.24-25
qemu-server: 1.1-18
pve-firmware: 1.0-8
libpve-storage-perl: 1.0-14
vncterm: 0.9-2
vzctl: 3.0.24-1pve4
vzdump: 1.2-7
vzprocps: 2.0.11-1dso2
vzquota: 3.0.11-1
pve-qemu-kvm: 0.12.5-1
 
Last edited:
The we interface should show the same value as the free command ('used' value in the -/+buffer/cache line). That works here.

Please can you post the output of free and the corresponding value you get on the web interface? And the value of /sys/kernel/mm/ksm/pages_sharing too.
 
Hi,

Yes i see the memory usage is looking the same, for some reason i thought it was different so that's fine, i'm just curious about the KSM and how it comes into play, it says it's working and has shared pages but it doesn't seem to reflect that very much. I could be wrong though.
Code:
xxx:~# free -m
             total       used       free     shared    buffers     cached
Mem:          3944       2899       1044          0        194        512
-/+ buffers/cache:       2193       1751
Swap:         4095        369       3726
Code:
xxx:~# cat /sys/kernel/mm/ksm/pages_sharing
359476
Thanks,
Nick D.
Canhost.ca
 
KSM is saving you 1472MB (359476 X 4096)
You are using 2899MB of RAM, of that 2899MB 194MB used used by buffers and 512MB used by cache.
The kernel uses the free memory for buffers/cache when it can.
So in reality you are only using 2193MB or RAM and have have 1751MB free

If you turned off KSM I believe you would only have 1751-1472 = 279MB free