Admin-Ahead Community

Linux => Control Panels => cPanel => Topic started by: mohitht on January 13, 2014, 10:34:59 pm

Title: Clear Cached Memory on cPanel
Post by: mohitht on January 13, 2014, 10:34:59 pm
Hey Guyz,


In Linux sometimes the cached memory wont be deleted since the OS will think that the cached memory is used and it will be needed for future operations so it wont be removed thus some memory related issues can happen.
In order to remove the cached memory follow the steps below

To flush the cached memory by

# echo 1 > /proc/sys/vm/drop_caches


To remove the cached memory within a particular time limit ,We can set a cron job with a particular time interval like 1hr or 2hr etc .

create a bash shell script file by

# vi /root/removecache.sh



Insert the following command into it

#!/bin/sh
sync; echo 3 > /proc/sys/vm/drop_caches


Save the following and set a cron job by

0 * * * * /root/removecache.sh


enable the cron job.

That's it  :)
:) ;)