Don’t panic if you see your Linux installation is using all the memory, it may not necessarily be a bad thing.
Why Linux Has Zero Free RAM?
The answer is
Disk Caching . Disk caching is a process when Linux is borrowing unused memory to make system run faster and smoother.
Can I Stop Linux From Doing This?
Short answer is no. Linux does this automatically. If your applications want more memory, they just take back a chunk of memory that disk cache borrowed. So there is no need to worry that Linux’s disk cache is taken the memory away from the applications.
How To Tell How Much Free Ram Linux Has
free -m and you will see something similar to the following. available column tells you how much free memory you really have.
total used free shared buff/cache available Mem: 1504 1491 13 0 855 869 Swap: 2047 6 2041
If you are running older distribution, look at the -/+ buffers/cache row under the free column:
total used free shared buffers cached Mem: 1504 1491 13 0 91 764 -/+ buffers/cache: 635 869 Swap: 2047 6 2041
You may have genuine low memory issue if you see the available memory or -/+ buffers/cache is close to zero. You will need to investigate which application is using a big chunk of the ram and either optimize its memory usage or add more ram depend on the situations you have on hand.