[root@VM_0_5_centos ~]# free -h
total used free shared buff/cache available
Mem: 3.7G 2.5G 132M 900K 1.1G 935M
Swap: 0B 0B 0B
buff/cache占用的内存大
这个时候可以使用一下命令去清除一下cache内存
echo 1 > /proc/sys/vm/drop_caches
echo 2 > /proc/sys/vm/drop_caches
echo 3 > /proc/sys/vm/drop_caches
drop_caches的值可以是0-3之间的数字,代表不同的含义:
0:不释放(系统默认值)
1:释放页缓存
2:释放dentries和inodes
3:释放所有缓存
[root@VM_0_5_centos ~]# free -h
total used free shared buff/cache available
Mem: 3.7G 2.5G 1.0G 892K 182M 1.0G
Swap: 0B 0B 0B
[root@VM_0_5_centos ~]#