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.
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
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
10 * * * * sync; “echo 3 > /proc/sys/vm/drop_caches”
You’re done check memory usage linux find memory usage linux linux free memory clear cache in linux