使用命令free -m
查看内存的时候发现,cache/buff
非常高,16g内存占了13g了,并且一直没有自动回收,只能手动清除了
示例:
total used free shared buff/cache available
Mem: 15885 753 1367 0 13763 13812
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 -m
以M显示
free -g
以G显示