Clear RAM Memory Cache, Buffer and Swap Space on Linux

From Knowledge Center
Jump to: navigation, search

Clear PageCache only:

$ sync; echo 1 > /proc/sys/vm/drop_caches

Clear dentries and inodes:

$ sync; echo 2 > /proc/sys/vm/drop_caches

Clear PageCache, dentries and inodes:

$ sync; echo 3 > /proc/sys/vm/drop_caches