免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 11528 | 回复: 17
打印 上一主题 下一主题

CentOS下跑应用 内存不释放 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-08-12 15:03 |只看该作者 |倒序浏览
本帖最后由 xppxyy 于 2011-08-12 15:10 编辑

大致情况如下

系统CentOs 5.6
内存是16G

weblgic jvm分配是的7G

系统开启的时候内存用掉700多M
开启weblgic后内存用掉4G多


然后开始跑应用
客户端loadrunner 1000用户并发请求 free 内存 逐渐上升 到最后空闲停留在80M  而此时swap 却没有使用 仍然是11G多

kill 掉weblogic 进程 内存释放7G 但系统仍然使用了8G

top命令和查看系统进程都没有看见8G 是那个进程占掉了。
有什么命令能看这8G到底是什么进程在使用






如上图 我kill   java后 只能释放active 里面的6G多 仍然有8G在使用

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
2 [报告]
发表于 2011-08-12 19:40 |只看该作者
Linux把内存当缓存使用了

论坛徽章:
0
3 [报告]
发表于 2011-08-12 20:10 |只看该作者
linux 内存就这样...   

想释放的话

     sync

     echo 3  >  /proc/sys/vm/drop_caches    释放的很痛快

论坛徽章:
0
4 [报告]
发表于 2011-08-12 20:30 |只看该作者
嗯 谢谢两位 我看看

论坛徽章:
0
5 [报告]
发表于 2011-08-12 20:31 |只看该作者
linux 内存就这样...   

想释放的话

     sync

     echo 3  >  /proc/sys/vm/drop_caches    释 ...
taojie2000 发表于 2011-08-12 20:10



     这两个命令具体是什么意思额?

论坛徽章:
0
6 [报告]
发表于 2011-08-12 20:46 |只看该作者
本帖最后由 chenyx 于 2011-08-12 20:50 编辑

回复 5# xppxyy


Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cache and/or inode and dentry caches on command, which can help free up a lot of memory. Now you can throw away that script that allocated a ton of memory just to get rid of the cache...

To use /proc/sys/vm/drop_caches, just echo a number to it.

To free pagecache:
  1. echo 1 > /proc/sys/vm/drop_caches
复制代码
To free dentries and inodes:
  1. echo 2 > /proc/sys/vm/drop_caches
复制代码
To free pagecache, dentries and inodes:
  1. echo 3 > /proc/sys/vm/drop_caches
复制代码
This is a non-destructive operation and will only free things that are completely unused. Dirty objects will continue to be in use until written out to disk and are not freeable. If you run "sync" first to flush them out to disk, these drop operations will tend to free more memory.

评分

参与人数 2可用积分 +8 收起 理由
shenbo7 + 2 靠,,,原来是这么回事啊.....
chenyx + 6 感谢分享

查看全部评分

论坛徽章:
0
7 [报告]
发表于 2011-08-12 20:49 |只看该作者
回复  xppxyy


Kernels 2.6.16 and newer provide a mechanism to have the kernel drop the page cac ...
taojie2000 发表于 2011-08-12 20:46



    3 Q 英语不太好,我学习下

论坛徽章:
0
8 [报告]
发表于 2011-08-12 21:11 |只看该作者
重启后  /proc/sys/vm/drop_caches 就变成0 了? 怎么能设置成3?

论坛徽章:
381
CU十二周年纪念徽章
日期:2014-01-04 22:46:58CU大牛徽章
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大牛徽章
日期:2013-03-13 15:38:52CU大牛徽章
日期:2013-03-14 14:08:55CU大牛徽章
日期:2013-04-17 11:17:19CU大牛徽章
日期:2013-04-17 11:17:32CU大牛徽章
日期:2013-04-17 11:17:37CU大牛徽章
日期:2013-04-17 11:17:42CU大牛徽章
日期:2013-04-17 11:17:47CU大牛徽章
日期:2013-04-17 11:17:52CU大牛徽章
日期:2013-04-17 11:17:56
9 [报告]
发表于 2011-08-12 21:16 |只看该作者
直接echo 3 > /proc/sys/vm/drop_caches就赋值了

论坛徽章:
59
2015七夕节徽章
日期:2015-08-24 11:17:25ChinaUnix专家徽章
日期:2015-07-20 09:19:30每周论坛发贴之星
日期:2015-07-20 09:19:42ChinaUnix元老
日期:2015-07-20 11:04:38荣誉版主
日期:2015-07-20 11:05:19巳蛇
日期:2015-07-20 11:05:26CU十二周年纪念徽章
日期:2015-07-20 11:05:27IT运维版块每日发帖之星
日期:2015-07-20 11:05:34操作系统版块每日发帖之星
日期:2015-07-20 11:05:36程序设计版块每日发帖之星
日期:2015-07-20 11:05:40数据库技术版块每日发帖之星
日期:2015-07-20 11:05:432015年辞旧岁徽章
日期:2015-07-20 11:05:44
10 [报告]
发表于 2011-08-12 22:09 |只看该作者
学习了。不错。原来还可以这样。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP