先看看内存使用状况 [[email protected] ~]# free -m total used free shared buffers cached Mem: 8004 6557 1446 0 163 5630 -/+ buffers/cache: 763 7240 Swap: 1983 0 1983 把内存里的数据暂时写到硬盘里 [[email protected] ~]# sync 修改 /proc/sys

先看看内存使用状况

[[email protected] ~]# free -m
total used free shared buffers cached
Mem: 8004 6557 1446 0 163 5630
-/+ buffers/cache: 763 7240
Swap: 1983 0 1983

把内存里的数据暂时写到硬盘里

[[email protected] ~]# sync

修改 /proc/sys/vm/drop_caches文件

[[email protected] ~]# echo 3 > /proc/sys/vm/drop_caches
[[email protected] ~]# cat /proc/sys/vm/drop_caches

再看内存

[[email protected] ~]# free -m
total used free shared buffers cached
Mem: 8004 631 7372 0 0 60
-/+ buffers/cache: 570 7433
Swap: 1983 0 1983

终于释放出来了。