Linux clear cached memory

 

By clearing cache we can make some free memory.

Clearing cache will drop clean caches, dentries and inodes from memory.

Following are 3 commands to clear cache:

To clear page cache:

$ sync && echo 1 | sudo tee /proc/sys/vm/drop_caches

To clear dentries and inodes:

$ sync && echo 2 | sudo tee /proc/sys/vm/drop_caches

To clear page cache, dentries and inodes:

$ sync && echo 3 | sudo tee /proc/sys/vm/drop_caches

 

Advertisements

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