Categories
Linux Software

Clear disk cache on Linux

I have been doing a bit benchmarking in the previous days, and have then needed to clear the disk cache from RAM without wanting to reboot each time. The command i use for that is:

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

Which tells the kernel to free pagecache, dentries and inodes.