How to drop cache in Linux

echo 3 > /proc/sys/vm/drop_caches

https://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://www.kernel.org/doc/Documentation/sysctl/vm.txt
drop_caches

Writing to this will cause the kernel to drop clean caches, as well as
reclaimable slab objects like dentries and inodes.  Once dropped, their
memory becomes free.

To free pagecache:
	echo 1 > /proc/sys/vm/drop_caches
To free reclaimable slab objects (includes dentries and inodes):
	echo 2 > /proc/sys/vm/drop_caches
To free slab objects and pagecache:
	echo 3 > /proc/sys/vm/drop_caches

 

Advertisements

Author: rajukv

Hadoop(BigData) Architect and Hadoop Security Architect can design and build hadoop system to meet various data science projects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s