首页 > 系统服务 > 详细

linux flushing file system caches

时间:2019-04-25 12:02:45      阅读:154      评论:0      收藏:0      [点我收藏+]

We may drop the file system caches on Linux to free up memory for applications. Kernels 2.6.16 and newer provide a mechanism via the /proc/ to make the kernel drop the page cache and/or inode and dentry caches on command. We can use this mechanism to free up the memory. However, this is a non-destructive operation that only free things that are completely unused and dirty objects will not be freed until written out to disk. Hence, we should flush these dirty objects to disk first. We can run sync to flush them out to disk. And the drop operations by the kernel will free more memory.

We can flush caches of the file systems by two steps:

Flush file system buffers

Call the sync command:

# sync
Free pagecache, dentries and inodes

Just echoing a number to /proc/sys/vm/drop_caches:

# echo 3 > /proc/sys/vm/drop_caches

linux flushing file system caches

原文:https://www.cnblogs.com/longchang/p/10767434.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!