博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

Unix爱好者家园

卓越源代码  
   sdccf.cublog.cn
关于作者  
姓名:sdccf
职业:chinapost
年龄:36
位置:sd
个性介绍:

我的分类  




释放linux系统的内存
作者: Dssiuet  出自: http://www.linuxdiyf.com
今天惊愕地发现,主节点上8G内存被不知道什么进程吃掉了整整6G有余,正常的计算快要维持不下去了,遂处理之。

先看看内存使用状况

[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

终于释放出来了。

 发表于: 2008-05-31,修改于: 2008-05-31 09:54 已浏览223次,有评论0条 推荐 投诉

  网友评论

  发表评论



Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们
页面生成时间:2.40795

京ICP证041476号