How to Clear RAM Memory Cache, Buffer and Swap Space on Linux
The following commands are tested on Centos 6/7/8
STEPS
[root@keklf-cls01 ~]# free -g
For example, the above shows that there is a total 503GB of RAM, but only 43GB is actively being used, and 2GB free. 453GB is in Cache and probably not used at all. To release the memory from the cache, run below commands.
# sync; echo 1 > /proc/sys/vm/drop_caches
# sync; echo 2 > /proc/sys/vm/drop_caches
# sync; echo 3 > /proc/sys/vm/drop_caches
Kindly comment below if it works for you.