Linux 释放内存方法
先看看内存使用状况[root@node1 ~]# free -mtotal used free shared buffers cachedMem: 8004 6557 1446 0 163 5630-/+ buffers/cache: 763 7240Swap: 1983 0 1983把内存里的数据暂时写到硬盘里[root@node1 ~]# sync修改 /proc/sys/vm/drop_caches文件[root@node1 ~]# echo 3 > /proc/sys/vm/drop_caches[root@node1 ~]# cat /proc/sys/vm/drop_caches再看内存 [root@node1 ~]# free -m total used free shared buffers cachedMem: 4051 1649 2401 0 202 1239-/+ buffers/cache: 208 3842Swap: 5535 0 5535 [root@node1 ~]#free -m total used free shared buffers cachedMem: 4051 139 3911 0 0 21-/+ buffers/cache: 117 3933Swap: 5535 0 5535[root@node1 ~]#