Usage
I am running vzfree on my VPSLink VPS (256MB OpenVZ).

# vzfree
             Total     Used     Free
Kernel:     49.83M    3.57M   46.26M
Allocate:  250.00M  103.91M  146.09M (256M Guaranteed)
Commit:    147.93M   53.07M   94.86M (47.6% of Allocated)
Swap:                 0.03M          (0.1% of Committed)
So how do they make sense?

Kernel is the “unswappable memory allocated by the operating system
kernel”. Each process will continue a bit of kernel memory.

Allocate shows the maximum amount that your processes can allocate
(via malloc(3) calls, i.e. the burstable memory), and how much has
already been allocated. It also shows the guaranteed amount (i.e. the
guaranteed memory).

You can see that on VPSLink, the burstable amount is actually less than
the guaranteed amount and it’s a feature instead of a bug according
to them to prevent overselling.

Commit shows the actual memory pages that have been used. On Linux it’s
possible to over-commit your memory as what you have allocated might
not be the same as what you have used. I have discussed them here, and
the amount under “Used” is the sum of physical pages + swapped pages.

The amount under “Total” is actually the out-of-memory kill guarantee,
i.e. if the host node is running out of memory, processes in your VE might
be killed if Used > Total. In fact it is possible to commit more pages
than OOM kill guarantee (so “Free” actually becomes negative). Watch
out for that if you are on a server that’s massively oversold.

The last number also shows the ratio between “allocated” and
“committed”. You’ll find this number very low if you are running
apps such as Java, MySQL, etc who allocate big chunks of memory but
don’t use all of them at once.

Swap is my guess on how many pages have been swapped on the physical
node. Bean counts tell you how many RAM pages are used so it should be
possible to work out the proximity of swap from other values. If the
percentage of committed memory have been swapped is high, then you know
your host is overselling.

Hopefully this little util is making more sense out of memory information
from the bean counters.
