清除Linux缓存

| |
[ 2011/04/21 12:59 | by Sonic ]
Writing to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.

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.

[root@server test]# cat /proc/sys/vm/drop_caches
0

/proc/sys/vm/drop_caches的值,默认为0
简单说,清除系统对内存的cache,使用root做下面几步:
sync; echo 3 > /proc/sys/vm/drop_caches
sync; echo 0 > /proc/sys/vm/drop_caches






最后编辑: Sonic 编辑于2011/04/21 13:38
Tags: ,
网摘-网事 | 评论(2) | 引用(0) | 阅读(3046)
Share |
滑动门 Email Homepage
2011/04/26 15:28
介绍的挺详细的,学习了
Sonic 回复于 2011/04/26 16:04
类似的广告,发一次即可。。发多了就准备屏蔽了啊。
大麦CC Email Homepage
2011/04/22 09:49
介绍的挺详细不错,不过这个我很早就会了
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]