Linux 清理内存的 Cache、Buffer 和交换空间

Linux About 434 words

查看内存

free -m

输出

root@root:~# free -g
               total        used        free      shared  buff/cache   available
Mem:              61          28          10           0          22          32
Swap:              0           0           0

清理 buff/cache

清理页缓存

sync; echo 1 > /proc/sys/vm/drop_caches

清理目录项、inode

sync; echo 2 > /proc/sys/vm/drop_caches

清理页缓存、目录项、inode

sync; echo 3 > /proc/sys/vm/drop_caches

备注

无法在容器中执行。

Views: 374 · Posted: 2023-08-09

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh