Below is the command to clear memory cache :-

[root@root~]#  sync; echo 3 > /proc/sys/vm/drop_caches

Use the above command in cronjob using screipt

Login your server as a root user.

Then use it in script at “/root/” and enter folllowing contents

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

Make  the permission of ” /root/” to 755

[root@root~]#  chmod 755  /root/

Run the cronjob using  crontab file as below :-

  [root@root~]#  crontab -e  OR
    [root@root~]# Vi /var/spool/cron/root

Enter below  cron  to set cronjob for clearing cache in every hour

   0 * * * * /root/

Restart crond service

[root@root~]#  /etc/init.d/crond restart

Thats it you have done 🙂