Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Clear Cached Memory on cPanel  (Read 8923 times)

0 Members and 1 Guest are viewing this topic.

mohitht

  • Guest
Clear Cached Memory on cPanel
« 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  :) :) ;)