IT码农库

您当前所在位置:首页 > 操作系统 > RedHat/Centos

RedHat/Centos

linux系统如何释放内存

互联网 佚名2008-09-08RedHat/Centos3713
先看看内存使用状况[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

先看看内存使用状况

[root@node1 ~]# free -m
total used free shared buffers cached
Mem: 8004 6557 1446 0 163 5630
-/+ buffers/cache: 763 7240
Swap: 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 cached
Mem: 8004 631 7372 0 0 60
-/+ buffers/cache: 570 7433
Swap: 1983 0 1983

终于释放出来了。

大图广告(830*140)