Clear System Cache

I have a tinny tiny laptop with only 960 MB of RAM. After installing PhpSysinfo I noted that my system was running at 98% of total available memory! As it turned out 356 MB were sitting in the system cache.   With a little digging, I found out how to clear the system cache safely (for me) so do it at your own risk. You've been warned!

First, run the sync command to ensure all cache is clear. You can do this by executing as root or simply use sudo command, (I did it as root.) 

# sync

Then,  run the following command:

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

That's it.  After refreshing my little PhpSysinfo, I noted system cache dropped to 172 MB from 356 MB; and I am running at 58% of RAM.  What a beauty!

Sources
http://ubuntuforums.org/showthread.php?t=589975
http://aplawrence.com/Linux/buffer_cache.html 

0 comments:

Post a Comment