Question
-
No free memory is presented as a result of the
free
command:# free -mh
total used free shared buffers cached
Mem: 1.0G 1.0G 0B 599M 0B 649M
-/+ buffers/cache: 374M 649M
Swap: 1.0G 21M 1.0G -
Why does the server use 100% of available memory?
Answer
Even though in the output above the amount of free memory is equal to 0, caches and buffers will be freed automatically if memory gets scarce
The amount of “real” free memory is equal to the sum of cached plus buffers memory. This value is displayed as the second value in the third line of free command (“-/+ buffers/cache” line):
# free -mh
total used free shared buffers cached
Mem: 1.0G 1.0G 0B 599M 0B 649M
-/+ buffers/cache: 374M 649M
Swap: 1.0G 21M 1.0G
In the example above, the “real” free memory is equal to 649 MB