Clear cached memory on cpanel server

By default the Linux OS is very efficient memory management process that should be freeing any cached memory on the machine that it is being run on. However when it comes to Cached memory the Linux OS may at times decide that the Cached memory is being used and is needed which can lead to memory related issues.

You can use the following command to flush your cache memory

[email protected] [~]# echo 1 > /proc/sys/vm/drop_caches

In order to remove cached memory on every hour the cron job will run this command and clear any memory cache that has built up.

create file to clear cache memory

vi /root/

and paste the following commands.

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

save and add this script in your cron job.

0 * * * * /root/

Thats all.. This script will remove cached memory automatically after every hour.


Get Free cPanel Knowledge Base

Thank you for subscribing.

Something went wrong.

4.36 avg. rating (87% score) - 11 votes