Tuesday, January 29, 2013

Clear Memory in Linux

This is a script to clear the memory. This script is typically useful for servers that use squid. Squid as a proxy so greedy with memory. Create a file to put this script, for example file "clearmemory". And place it in the folder /etc/cron.daily/, in order to run automatically every day.
vim /etc/cron.daily/clearmemory.
#!/bin/bash
sync;
echo 3 > /proc/sys/vm/drop_caches

save, and change the permission.
chmod 755 /etc/cron.daily/clearmemory.


Checkthe amount of memory in your computer with the command "top". And you will see the changes before and after running the file clearmemory.
putty - top


1 comment:

  1. You are an awesome blogger. This is one of the best blog I had visited so far. Hope to read more post from you in the future. Keep it up. God bless.

    www.gofastek.com

    ReplyDelete