Linux中buff/cache内存占用过高进行清除

buff和cache占用资源多

在使用free -h的时候,会发现buff/cache占用资源很多,如下图所示。
在这里插入图片描述

什么是 buff和cache

buff是即将要被写入磁盘的,而cache是被从磁盘中读出来的。

手动清除buff/cache

使用root账户执行以下命令

echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches

清除buff/cache后

在这里插入图片描述

你可能感兴趣的:(linux-shell,生活与工作,linux)