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
相关文章
- 11-11linux 虚拟文件系统----------Virtual File System VFSkky
- 11-11.net 5.0 在linux 启动报错 System.IO.FileNotFoundException:Unable to find the specified file. at Interop.Sys.GetCwdHepler.....
- 11-11云服务器 linux文件系统异常an error occurren during the file system check导致服务器启动失败
- 11-11「Linux」Ubuntu VMware-Tools Cannot mkdir: Read-only file system
- 11-11Linux文件虚拟机系统只读Read-only file system的快速解决方法
- 11-11linux flushing file system caches
- 11-11Linux File System
- 11-11Linux文件目录变只读(Read-only file system)导致mysql启动失败
- 11-11Linux File System Change Monitoring Technology、Notifier Technology
- 11-11linux系统重启后提示An error occurred during the file system check.