Mem: total figure is the total amount of RAM that can be used by applications. This is the total RAM installed on the system, minus:
- memory reserved by hardware devices (often video memory if the graphics card doesn't have its own RAM);
- memory used by the kernel itself.
That total includes:
free: memory that is currently used for any purpose;
shared: a concept that no longer exists. It's left in the output for backward compatibility (there are scripts that parse the output from
free). (On current systems you'll typically see nonzero values because
shared has been repurposed to show memory that's explicitly shared via a shared memory mechanism. On older systems, it included files mapped by more than one process and shareable memory that remained shared after
buffers: memory that is backed by files, and that can be written out to disk if needed;
cache: memory that is backed by files, and that can be reclaimed at any time (the difference with
buffers is that buffers must be saved to disk before they're reused, whereas cache consists of things that can be reloaded from disk);
used -buffers/cache: memory used by applications (and not paged out to swap).
In a pinch, the system could run without buffers and cache, reserving RAM for applications and systematically performing disk reads and writes without any caching. The
-/+ buffers/cache figures indicate the amount of RAM used directly by applications (
used column) and the amount of RAM not used by applications (
Although this can vary a lot, a healthy system typically has around half its RAM devoted to applications and half devoted to buffers and cache. Unless you're running a dedicated file server, your system has more RAM than it needs for what you're currently doing. If the
free - buffers/cache figure was low, that would indicate a system that doesn't have enough RAM (contrary to a widespread belief, having a lot of memory devoted to buffers and cache is important for system performance, and trying to reserve more memory for applications would make 99.99% of systems slower).
swap line is straightforward, it shows the amount of swap that's in use (either by applications or for
tmpfs storage), and the amount that isn't.