How to Clear RAM Memory Cache, Buffer and Swap Space in Manjaro?

I came across this link and apparently it’s possible to flush memory in linux form the command line.

echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches 
sync

Are these commands safe? Anyone have any experience?

Thanks!

1 Like

While there might be use cases to do so (big compiling project, etc); IMO doing this arbitrarily is just wasting your RAM-the OS will clear the caches as needed.

(1) Documentation for /proc/sys/vm/ — The Linux Kernel documentation

3 Likes