Pages

Wednesday, February 26, 2014

How to clear cache in Linux

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

$sync; echo 3| sudo tee /proc/sys/vm/drop_caches
Clean up cached memory on linux

$sync && echo 3| sudo tee /proc/sys/vm/drop_caches
Clear Filesystem memory cache

$/sbin/sysctl –w vm.drop_caches=3
Release memory used by the Linux kernel on caches
-1 to free pagecache
-2 to free dentries and inodes
-3 to free pagecache,dentries and inodes

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

$sudo sync && sudo echo 3 | sudo tee /proc/sys/vm/drop_caches
Clear Cached memory on Ubuntu/Rhel
OR

# echo 3 > /porc/sys/vm_drop_caches