清除linux缓存命令
命令
#sync
#echo?3?>?/proc/sys/vm/drop_caches
?
查看內存情況:
#?more?/proc/meminfo
?
Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...
To use /proc/sys/vm/drop_caches, just echo a number to it.
To free pagecache:
# echo 1 > /proc/sys/vm/drop_cachesTo free dentries and inodes:
# echo 2 > /proc/sys/vm/drop_cachesTo free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_cachesThis is a non-destructive operation and will only free things that are completely unused. Dirty objects will continue to be in use until written out to disk and are not freeable. If you run "sync" first to flush them out to disk, these drop operations will tend to free more memory.
轉載于:https://www.cnblogs.com/davidwang456/p/3368784.html
總結
以上是生活随笔為你收集整理的清除linux缓存命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux主机间复制文件
- 下一篇: linux shell 流程控制(条件i