Skip to content

Clear Memory Cache in Linux

TL;DR

How to Clear RAM Cache in Linux?

purging all cached data

pageCache, dentries, and inodes from the cache memory

sync; echo 3 | sudo tee /proc/sys/vm/drop_caches

remove only dentries and inodes

sync; echo 2 | sudo tee /proc/sys/vm/drop_caches

clear the page cache

sync; echo 1 | sudo tee /proc/sys/vm/drop_caches

check cached memory

free -h
Feedback