How to Clear RAM Memory Cache, Buffer and Swap Space on Linux

The following commands are tested on Centos 6/7/8


[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.


Leave a reply

Your email address will not be published. Required fields are marked *


©2023 ZMATECH: Innovative solutions for your IT challenges.


We're not around right now. But you can send us an email and we'll get back to you, asap.


Log in with your credentials

Forgot your details?