linux – drop data caches

Sometimes it useful drop memory caches:

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

if you need sudo and more options then:

echo 1 | sudo tee /proc/sys/vm/drop_caches  # drop pagecache
echo 2 | sudo tee /proc/sys/vm/drop_caches  # drop dentries and inodes
echo 3 | sudo tee /proc/sys/vm/drop_caches  # drop pagecache, dentries and inodes

Leave a Reply

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