Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


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

Linux 大约 434 字

查看内存

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

备注

无法在容器中执行。

阅读 209 · 发布于 2023-08-09

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

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

扫描二维码关注我
昵称:
随便看看 换一批