Difference between free -m and ps -euf

The buffers and cache are dynamically sized. If processes need more space, then it is taken from the buffers and the cache.

The key is to look at the second line ("-/+ buffers/cache").

Mem:           496        489          6          0          4        452
-/+ buffers/cache:         33        462

Notice that the free in the second line (462) is the sum of 6 (free), 4 (buffers) and 452 (cached). This is the real amount of free space. If this falls too low, then the system would start swapping processes out of memory to swap space.

So in reality, you are using 33MB of memory and have available 462MB - probably slightly less since you would still need some buffers for i/o.


Apart from the correct explanation by Arcege, there are also two other misconceptions hidden in your interpretation of ps euf.

  1. The command ps euf does not list all the processes - you should use ps axeuf for that.

  2. Percentages of used memory for each process are given, as you can see, rounded to 0.1%. So adding them up will give erroneous results - (roughly) all processes use some memory - even if it is less then 0.1%. If there are, for instance, 20 processes that use 0.05%, they'd add up to 1%, not 0%.

Tags:

Memory

Ps