Useful Linux command to purge/flush/clean/free up memory (drop cache)
Linux usually cache as much data as possible to faster access. It automatically manage the memory for you. However, sometimes you might want to free up the memory yourself in case Linux is not doing it’s job. Here are the commands for you to do that.
-
Useful Linux Command to Purge/flush/clean/free Up Memory (drop Cache)
milly
milly 11:47 am on June 22, 2011
Running these commands make the kernel to drop clean caches, dentries and inodes from memory. These are non-destructive operation, and dirty objects will remain in the memory:
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches