ubuntu buff/cache占用空间过大解决方法

前端之家收集整理的这篇文章主要介绍了ubuntu buff/cache占用空间过大解决方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

背景:服务器上传codis的备份文件到服务器之后,发现codis无法工作,经过查看log发现原来是内存不够导致的。

如图所示:

# free -g
 
              total        used        free      shared  buff/cache   available
Mem:             62          34           0           0          28          28
Swap:             0           0           0

解决方法

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

清除缓存后空间为:

# free -g

              total        used        free      shared  buff/cache   available
Mem:             62          34          28           0           0          28
Swap:             0           0           0


猜你在找的Linux相关文章