Thursday 12 March 2015

Flushing cached memory on a LINUX machine

Linux memory management system is so wise to keep the details of data that was used recently in cache memory

We can flush, the cached memory using the below commands:

Case 1:  To free pagecache, dentries and inodes in cache memory
sync; echo 3 > /proc/sys/vm/drop_caches

Case 2: To free dentries and inodes use following command
sync; echo 2 > /proc/sys/vm/drop_caches

Case 3: To free pagecache only use following command
sync; echo 1 > /proc/sys/vm/drop_caches

So, if you need to spontaneously free up memory for some application. You can use any of the above commands.

Kool :)

No comments:

Post a Comment

Note: only a member of this blog may post a comment.