free cache from memory
Linux usually uses its RAM the smartest way it can. It uses the memory first the makes cache for the recurring requests. Whenever any app needs memory the cache is freed up for that. However if you specifically need to free up the linux cache memory here are some tips. I found them working good.
To free pagecache:
- echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
- echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
- echo 3 > /proc/sys/vm/drop_caches
As this is a non-destructive operation, and dirty objects are not freeable, the user should run “sync” first in order to make sure all cached objects are freed.
This tunable was added in 2.6.16.
Thanks to LinuxInsight
| Print article | This entry was posted by Ameya on December 16, 2010 at 10:32 am, and is filed under linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |