$sync
通过修改proc系统的drop_caches清理free的cache
$echo 3 > /proc/sys/vm/drop_caches
drop_caches的详细文档如下:
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 notfreeable, the user should run “sync” first in order to make sure allcached objects are freed.
本文介绍如何使用Linux的proc系统中的drop_caches参数来释放内存缓存,包括页缓存、目录项缓存和inode缓存。为了确保缓存的安全释放,建议先执行sync命令。
1552

被折叠的 条评论
为什么被折叠?



