Showing posts with label drop caches. Show all posts
Showing posts with label drop caches. Show all posts

Linux: release cache memory

Hi!

Sometimes it may be useful to release some of the cache memory under Linux OS environment.

Here is a simple script which does that:
---------
#!/bin/sh
sync;
sudo sync;
echo 1 > /proc/sys/vm/drop_caches;
echo 2 > /proc/sys/vm/drop_caches;
echo 3 > /proc/sys/vm/drop_caches;
sync;
sudo sync;

echo "WOW! I feel good :D"

---------

Save it under preferred name, e.g. cleaner.sh
Run it as a sudo: sudo sh cleaner.sh
That's it!