清理linux cache

csbin發表於2014-01-16

[root@testlfy ~]# sync

[root@testlfy ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         24161      23602        559          0        343      18430
-/+ buffers/cache:       4828      19333
Swap:        10239          0      10239

[root@testlfy ~]# echo 3 > /proc/sys/vm/drop_caches

[root@testlfy ~]# free -m
             total       used       free     shared    buffers     cached
Mem:         24161       4820      19341          0          0        680
-/+ buffers/cache:       4138      20023
Swap:        10239          0      10239

 

 

To free pagecache, use

echo 1 > /proc/sys/vm/drop_caches;

 

to free dentries and inodes, use

echo 2 > /proc/sys/vm/drop_caches;

 

to free pagecache, dentries and inodes, use

echo 3 >/proc/sys/vm/drop_caches

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/720091/viewspace-1071313/,如需轉載,請註明出處,否則將追究法律責任。

相關文章