OpenVZ places quota limits on both the consumed and reserved/allocated memory your VPS is allowed. See /proc/user_beancounters for quota details:
privvmpages = allocation limit, also commonly referred to as the "burst" limit.
vmguarpages = "guaranteed" memory allocation.
A key point is that except in very unusual circumstances you can temporarily exceed the guaranteed limit, but the burst limit will always be applied. So effectively, the real limitation on your usage of an OpenVZ VPS is the burst memory limit, not the guaranteed. A complicating factor is that when you use top or free, the numbers you see are allocated (burst) memory, not true usage - so generally you'll get a significant overestimate of memory used.
So in summary:
* Ignore the guaranteed memory - it's pretty much meaningless. When selecting options, instead focus on keeping the burst memory limit at about twice the needed memory.
* Don't believe the output of free -m. Instead go straight to /proc/user_beancounters for the real picture. Or even better, use this script (1st number is guaranteed memory in MB, 2nd is burst limit in MB):
Code:
for v in vmguarpages privvmpages;do expr `cat /proc/user_beancounters |grep $v |awk -F' ' '{print $4}'` / 256;done
