While the System is quite likely to use whatever RAM you throw at it (after enough I/O), it does by far not need all of that.
All usual Distributions of Linux are preconfigured to aggressivly use RAM as a disk cache if - and only if - it is not needed elsewhere: The head of the output of top
will look something like
Tasks: 407 total, 3 running, 404 sleeping, 0 stopped, 0 zombie
%Cpu(s): 12,6 be, 11,2 sy, 0,0 ni, 76,1 un, 0,0 wa, 0,0 hi, 0,0 si, 0,0 st
KiB Mem: 16425304 total, 15497560 used, 927744 free, 221476 buffers
KiB Swap: 0 total, 0 used, 0 free. 7057660 cached Mem
(My machine at the time of writing with lots of open programs). This means, that while from a total of ca. 16G (16425304 KB) something like 15.2G (15497560 KB) are used, but of these some 210M (221476 KB) are used for block device buffers and ca. 7G (7057660 KB) are used for file system cache, resulting in less than 8G really used.
The command free -m
gives a much better idea, as it does the maths for you: In the line -/+ Buffer/Cache
it shows you what the system realy uses, with buffers and cache already subtracted.
You can find similar answer in Arch Wiki FAQ - Why is Arch using all my RAM?. See also: linuxatemyram.com and this article. ;-)
– patryk.beza – 2017-01-11T21:06:49.487