高访问量jetty持续消耗内存问题-第一次发帖,求大牛解答:报错 -问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

高访问量jetty持续消耗内存问题-第一次发帖,求大牛解答:报错

kun坤 2020-06-14 13:48:50 60

*环境:linux+ngixn+jetty
*问题描述:jetty启动后,经过一段时间(一般两个星期左右),内存消耗到没了,从内存消耗图看,是一个接近线性下降的趋势;*重启后jetty后,内存都可以释放完。(使用了ssl请求)
*数据提供:(总内存8G)
A、JVM启动参数:-Xmx5000m -Xms5000m -Xmn2000m -XX:PermSize=256m 

B、GC的情况:
2017-04-13T23:08:26.098+0800: 221108.011: [GC 221108.011: [ParNew
Desired survivor size 104857600 bytes, new threshold 6 (max 6)
- age   1:    5075328 bytes,    5075328 total
- age   2:     170664 bytes,    5245992 total
- age   3:     153136 bytes,    5399128 total
- age   4:     166792 bytes,    5565920 total
- age   5:     131288 bytes,    5697208 total
- age   6:     184864 bytes,    5882072 total
: 1645483K->6423K(1843200K), 0.0203310 secs] 3181438K->1542517K(4915200K), 0.0206690 secs] [Times: user=0.05 sys=0.00, real=0.02 secs] 
2017-04-13T23:08:26.127+0800: 221108.040: [GC [1 CMS-initial-mark: 1536094K(3072000K)] 1547277K(4915200K), 0.0367910 secs] [Times: user=0.01 sys=0.00, real=0.04 secs] 
2017-04-13T23:08:26.165+0800: 221108.078: [CMS-concurrent-mark-start]
2017-04-13T23:08:26.772+0800: 221108.685: [CMS-concurrent-mark: 0.607/0.607 secs] [Times: user=1.37 sys=0.21, real=0.61 secs] 
2017-04-13T23:08:26.772+0800: 221108.685: [CMS-concurrent-preclean-start]
2017-04-13T23:08:26.855+0800: 221108.769: [CMS-concurrent-preclean: 0.083/0.083 secs] [Times: user=0.12 sys=0.01, real=0.08 secs] 
2017-04-13T23:08:26.855+0800: 221108.769: [CMS-concurrent-abortable-preclean-start]
 CMS: abort preclean due to time 2017-04-13T23:08:31.866+0800: 221113.779: [CMS-concurrent-abortable-preclean: 4.873/5.010 secs] [Times: user=8.08 sys=0.65, real=5.01 secs] 
2017-04-13T23:08:31.869+0800: 221113.782: [GC[YG occupancy: 724914 K (1843200 K)]221113.951: [Rescan (parallel) , 0.2152830 secs]221114.167: [weak refs processing, 0.9604950 secs]221115.127: [class unloading, 0.0192670 secs]221115.147: [scrub symbol table, 0.0110620 secs]221115.158: [scrub string table, 0.0015560 secs] [1 CMS-remark: 1536094K(3072000K)] 2261008K(4915200K), 1.3161700 secs] [Times: user=1.92 sys=0.00, real=1.49 secs] 
2017-04-13T23:08:33.354+0800: 221115.268: [CMS-concurrent-sweep-start]
2017-04-13T23:08:34.581+0800: 221116.495: [CMS-concurrent-sweep: 1.176/1.227 secs] [Times: user=3.62 sys=0.16, real=1.22 secs] 
2017-04-13T23:08:34.581+0800: 221116.495: [CMS-concurrent-reset-start]
2017-04-13T23:08:34.603+0800: 221116.517: [CMS-concurrent-reset: 0.022/0.022 secs] [Times: user=0.04 sys=0.01, real=0.03 secs] 
2017-04-13T23:08:37.866+0800: 221119.780: [GC 221119.780: [ParNew
Desired survivor size 104857600 bytes, new threshold 6 (max 6)
- age   1:    8134688 bytes,    8134688 total
- age   2:     143856 bytes,    8278544 total
- age   3:     137752 bytes,    8416296 total
- age   4:     153072 bytes,    8569368 total
- age   5:     142208 bytes,    8711576 total
- age   6:     131224 bytes,    8842800 total
: 1644823K->9555K(1843200K), 0.0917760 secs] 2142002K->506915K(4915200K), 0.0922820 secs] [Times: user=0.29 sys=0.00, real=0.09 secs] 

C、运行free -m命令查看内存
                    total       used       free     shared    buffers     cached
Mem:          7870       7803         66          0         23       1013
-/+ buffers/cache:       6767       1103
Swap:         2047         71       1976

D、运行top命令查看
top - 09:48:13 up 180 days, 18:26,  1 user,  load average: 1.13, 1.37, 1.32
Tasks: 151 total,   3 running, 148 sleeping,   0 stopped,   0 zombie
Cpu(s): 23.7%us,  4.9%sy,  0.0%ni, 70.2%id,  0.1%wa,  0.0%hi,  0.7%si,  0.3%st
Mem:   8059448k total,  7925932k used,   133516k free,    21576k buffers
Swap:  2097144k total,    72880k used,  2024264k free,   981596k cached

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                 
10669 jetty     20   0 8589m 5.6g 5748 S 88.2 72.4  12059:18 java                                                                                                                                                                                     
 2186 nginx     20   0  143m  27m 1560 R  7.3  0.4   2093:23 nginx                                                       
。。。。

从上面的分析看,JVM的GC回收都没有问题,最后堆的占用不会很多,可是jetty的RES的占用达到了5.6G
有没有大神提供下思路,这到底是什么原因引起的?

Java 应用服务中间件 网络安全 nginx
分享到
取消 提交回答
全部回答(0)
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程