Redhat Linux7下如何用drop_caches手動清理快取
清理快取(drop_caches)的官方文件如下:
http://www.kernel.org/doc/Documentation/sysctl/vm.txt
==============================================================
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.
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free reclaimable slab objects (includes dentries and inodes):
echo 2 > /proc/sys/vm/drop_caches
To free slab objects and pagecache:
echo 3 > /proc/sys/vm/drop_caches
==============================================================
# cat /proc/sys/vm/drop_caches
0 //預設是0;1-清空頁快取;2-清空inode和目錄樹快取;3-清空所有快取
示例如下:
[root@chenfeng ~]# sync //在清空快取之前使用sync命令同步資料到磁碟
[root@chenfeng ~]# free -m
total used free shared buff/cache available
Mem: 1824 1165 93 10 566 421
Swap: 0 0 0
[root@chenfeng ~]# echo 3 > /proc/sys/vm/drop_caches //清空所有快取
[root@chenfeng ~]# free -m //可以看到快取buff/cache的值明顯減少了
total used free shared buff/cache available
Mem: 1824 1123 492 10 209 514
Swap: 0 0 0
http://www.kernel.org/doc/Documentation/sysctl/vm.txt
==============================================================
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.
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free reclaimable slab objects (includes dentries and inodes):
echo 2 > /proc/sys/vm/drop_caches
To free slab objects and pagecache:
echo 3 > /proc/sys/vm/drop_caches
==============================================================
# cat /proc/sys/vm/drop_caches
0 //預設是0;1-清空頁快取;2-清空inode和目錄樹快取;3-清空所有快取
示例如下:
[root@chenfeng ~]# sync //在清空快取之前使用sync命令同步資料到磁碟
[root@chenfeng ~]# free -m
total used free shared buff/cache available
Mem: 1824 1165 93 10 566 421
Swap: 0 0 0
[root@chenfeng ~]# echo 3 > /proc/sys/vm/drop_caches //清空所有快取
[root@chenfeng ~]# free -m //可以看到快取buff/cache的值明顯減少了
total used free shared buff/cache available
Mem: 1824 1123 492 10 209 514
Swap: 0 0 0
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2121300/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- pbootcms模板自動清理runtime快取,自動清理快取boot快取
- drop_caches Linux清空快取Linux快取
- OS X Yosemite下Dns快取清理方法MITDNS快取
- 清理 Conda 快取和 Pip 快取快取
- Nginx下快取靜態檔案(如css js)Nginx快取CSSJS
- 如何定期清理DNS快取?清理DNS快取有什麼用?DNS快取
- 網頁快取清理網頁快取
- linux清理快取Linux快取
- docker清理快取命令Docker快取
- PbootCMS快取如何清理runtime資料夾下經常滿怎麼辦?清理快取的方法boot快取
- linux docker 清理快取LinuxDocker快取
- 清理電腦快取垃圾快取
- windwos清理圖示快取快取
- 清理C盤快取,清理電腦C盤快取垃圾的操作步驟快取
- Linux下清理記憶體和Cache方法 /proc/sys/vm/drop_cachesLinux記憶體
- win10如何清理flash快取_win10清理fiash player快取的方法Win10快取
- Privatus for Mac網頁快取清理Mac網頁快取
- Laravel 路由快取檔案清理Laravel路由快取
- Win10怎麼清理DNS快取 Win10電腦dns快取清理命令Win10DNS快取
- Win10如何清理照片快取 win10系統清理照片快取的步驟Win10快取
- PbootCMS後臺自動清理快取runtime資料夾boot快取
- 伺服器快取怎麼清理伺服器快取
- Python中pycharm如何清理快取?PythonPyCharm快取
- iOS快取清理功能的實現iOS快取
- win10怎麼清理網路快取_win10電腦怎麼清理dns快取Win10快取DNS
- 如何清理MAC電腦的DNS快取MacDNS快取
- 伺服器DNS快取怎麼清理伺服器DNS快取
- win7如何清理圖示快取Win7快取
- Win10系統如何清理應用商店快取_win10清理應用商店快取的方法Win10快取
- 如何用REDIS實現分散式快取Redis分散式快取
- win10怎麼清理垃圾與快取_win10清理系統垃圾與快取檔案步驟Win10快取
- win10qq快取清理不乾淨怎麼辦|win10qq快取徹底清理的方法Win10快取
- linux下的快取機制及清理buffer/cache/swap的方法梳理Linux快取
- Mac瀏覽器快取清理軟體:CookieMac瀏覽器快取Cookie
- Cookie for Mac瀏覽器快取清理軟體CookieMac瀏覽器快取
- 瀏覽器快取清理工具:Cookie for Mac瀏覽器快取CookieMac
- 【知識分享】伺服器如何清理快取伺服器快取
- 網頁快取清理工具:Privatus 6 for Mac網頁快取Mac