How To Clear Cache Memory, Buffer Cache In Linux

How to clear cache, It’s a good idea to clear the memory on the server because it can slow down the server performance. There will be no problem with flushing the cache on the server. you can check and find free memory usage in Linux using the below commands.

How To Clear Cache Memory, Buffer Cache In Linux:

This can be done using a single command in the Linux server. you can also create a crontab which will run according to your need. This helps you when you have a web server running. 

Check Out: How To Setup Multi-Factor authentication In Amazon Web Service

As this is a non-destructive operation and dirty objects are not free able, You should run ‘sync’ first.

1. Free Pagecache

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

2. Free Dentries and inodes

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

Check Out: How To Create Route Tables In VPC Network On Amazon cloud

3. Free Pagecache, Dentries, and inodes

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

You can also create a script and run this using crontab

Check Out: Docker Swarm Error response from daemon: rpc error: code

crontab -e

10 * * * * sync; “echo 3 > /proc/sys/vm/drop_caches”

how to clear cache

You’re done check memory usage linux find memory usage linux linux free memory clear cache in linux

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment