码迷,mamicode.com
首页 > 系统相关 > 详细

buffer/cache

时间:2018-11-19 17:24:41      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:des   sys   proc   pre   inux   code   nbsp   释放   文件   

释放buffers&cached
sync
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
cache释放:
##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

注:
1.释放前最好sync一下,防止丢数据
2.因为LINUX的内核机制,一般情况下不需要特意去释放已经使用的cache。这些cache起来的内容可以增加文件以及的读写速度。

 

buffer/cache

标签:des   sys   proc   pre   inux   code   nbsp   释放   文件   

原文地址:https://www.cnblogs.com/stellar/p/9983705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!