如何释放pagecache、inodes、dentries
内核文档链接:https://www.kernel.org/doc/html/latest/admin-guide/sysctl/vm.html
内核文档对drop_caches的解释:
Writing to this will cause the kernel to drop clean caches, as well as reclaimable slab objects like dentries and inodes. Once dropped, their memory becomes free.
释放页面缓存(pagecache)
To free pagecache:
# echo
1
> /proc/sys/vm/drop_caches
或
# sudo sysctl -w vm.drop_caches=1
释放文件的数据结构和目录的数据结构(分别指inode 和 dentries)
To free dentries and inodes:
# echo
2
> /proc/sys/vm/drop_caches
或
# sudo sysctl -w vm.drop_caches=2
释放文件数据结构、目录数据结构和页面缓存
To free pagecache, dentries and inodes:
# echo
3
> /proc/sys/vm/drop_caches
或
# sudo sysctl -w vm.drop_caches=3
其它参考链接:
https://stackoverflow.com/questions/29870068/what-are-pagecache-dentries-inodes
版权声明:本文由老瓦罐儿煨汤发布,如需转载请注明出处。