Your server is within some kind of virtuozzo/openvz/virtualization-du-jour container. Trying to make sense of memory usage is tilting at windmills.
Linux ate your RAM! But that's okay, it does it to everyone.
The Long Story
Let's break it down!
Mem: section we have:
$n total: the amount of physical RAM in your machine
$n used: how much memory is being consumed by Linux, not just the sum of the processes.
$n free: How much RAM is not being consumed by Linux. This does not take into account that cached and buffered memory is in essence "free".
$n buffers: buffer space is where blocks of disk I/O having been read or pending a write are stored. A buffer is a RAM representation of a single disk block.
Swap: section we have:
$n total: Self explanatory. Amount of disk space available to swap pages to.
$n used: Self explanatory. How much disk swap space is used.
$n free: Herp Derp.
$n cache: Closely related to buffers above. It's actually part of the page cache and itself has no space on physical disk. Don't worry about the details for this conversation.
The interesting part comes when you run
free -m. You'll see three lines, and all of the numbers will correlate with top. I'll give my own PC as an example:
total used free shared buffers cached
Mem: 8070 7747 323 0 253 5713
-/+ buffers/cache: 1780 6290
Swap: 5055 0 5055
The Mem row shows total RAM in megabytes (
$n total in top), how much is used (
$n usedin top), how much is free (
$n free in top), how much is shared (ignore that), and now comes the good part! The
cached columns in
free -m correlate to, predictably,
$n buffers and
$n cache. But take a look at the second row that of
free -m that starts with
-/+ buffers/cache:. The math shows that the used amount is really (total)-((used-buffers)-cached). Free is (total)-(theNewUsed).
What does all this mean? It means that Linux ate your RAM! The short story is that the Linux kernel gobbles up RAM as it is available to use for disk caching. There's nothing you can do about it unless you feel like trying to compile a custom kernel. Pro Tip: Don't.
The RAM is really there and free for processes to use at their whim. That's what's meant by the
-/+ buffers/cache: row in
free -m. However, you're inside non hyper-visor virtualization container which makes things a bit squirrely. You simply can't take stock of your memory with byte accuracy at this point. However, you're not seeing any behavior that's terribly unusual.
Keep Calm and Carry On. Also, get a physical server (unless you like memory statistics that look like Kreskin is your SysAdmin).