Rav*_*pta 2 java garbage-collection jvm memory-leaks
我在prod环境中看到一些异常行为导致我们在运行Tomcat的服务器上出现高线程数.堆大小10,092,544K在新一代和产权生成之间分配为2,752,512K + 7,340,032K = 10,092,544K.
我很困惑为什么GC在堆上有足够的内存可用时多次运行(新旧两种)(Full GC [PSYoungGen:0K-> 0K(2752512K)] [ParOldGen:2748534K-> 2748529K(7340032K) )])
正如你可以看到0K-> 0K的年轻人和.27G - > .27G的老一代意味着几乎没有任何对象得到gc'd并且有很多可用的内存.(堆大小为10G).
由于Full GC在短时间间隔内运行多次,因此导致性能降低,因此应用程序无法处理传入的用户请求,因此无法处理服务器上的高线程,最终我们必须重新启动服务器以摆脱这种情况.
你能解释一下这里发生了什么.
这是gc.log上的输出.
..
更多...... ..
7月18日14:52:38 fwprodcontent03 gc.log:3172.122:[GC [PSYoungGen:0K-> 0K(2752512K)] 2750855K-> 2750855K(10092544K),0.0515920 secs] [次:用户= 0.32 sys = 0.01,real = 0.06秒]
7月18日14:52:42 fwprodcontent03 gc.log:3172.174:[Full GC [PSYoungGen:0K-> 0K(2752512K)] [ParOldGen:2750855K-> 2749937K(7340032K)] 2750855K-> 2749937K(10092544K)[PSPermGen:262143K - > 262115K(262144K)],4.1571260秒] [时间:用户= 44.29 sys = 0.06,实际= 4.15秒]
7月18日14:52:42 fwprodcontent03 gc.log:3176.361:[GC [PSYoungGen:9071K-> 1280K(2752512K)] 2759008K-> 2751217K(10092544K),0.0989600 secs] [次:用户= 0.64 sys = 0.01,real = 0.10秒]
7月18日14:52:46 fwprodcontent03 gc.log:3176.461:[全GC [PSYoungGen:1280K-> 0K(2752512K)] [ParOldGen:2749937K-> 2748847K(7340032K)] 2751217K-> 2748847K(10092544K)[PSPermGen:262143K - > 262121K(262144K)],3.1331910秒] [Tim es:user = 31.25 sys = 0.01,real = 3.14 secs]
7月18日14:52:46 fwprodcontent03 gc.log:3179.616:[GC [PSYoungGen:2161K-> 288K(2752512K)] 2751008K-> 2749135K(10092544K),0.0688890 secs] [次:用户= 0.42 sys = 0.02,real = 0.07秒]
7月18日14:52:49 fwprodcontent03 gc.log:3179.686:[Full GC [PSYoungGen:288K-> 0K(2752512K)] [ParOldGen:2748847K-> 2748930K(7340032K)] 2749135K-> 2748930K(10092544K)[PSPermGen:262143K - > 262143K(262144K)],3.2369940 secs] [时间s:用户= 32.23 sys = 0.02,real = 3.23 secs]
7月18日14:52:49 fwprodcontent03 gc.log:3182.923:[GC [PSYoungGen:0K-> 0K(2752512K)] 2748930K-> 2748930K(10092544K),0.0607190 secs] [次:用户= 0.39 sys = 0.01,real = 0.06秒]
7月18日14:52:57 fwprodcontent03 gc.log:3182.984:[Full GC [PSYoungGen:0K-> 0K(2752512K)] [ParOldGen:2748930K-> 2748528K(7340032K)] 2748930K-> 2748528K(10092544K)[PSPermGen:262143K - > 262141K(262144K)],8.5377730 secs] [次:用户= 98.30 sys = 0.57,real = 8.54 secs]
7月18日14:52:58 fwprodcontent03 gc.log:3191.533:[GC [PSYoungGen:202K-> 128K(2752512K)] 2748731K-> 2748656K(10092544K),0.1088430 secs] [次:用户= 0.67 sys = 0.00,real = 0.11秒]
7月18日14:53:02 fwprodcontent03 gc.log:3191.642:[Full GC [PSYoungGen:128K-> 0K(2752512K)] [ParOldGen:2748528K-> 2748534K(7340032K)] 2748656K-> 2748534K(10092544K)[PSPermGen:262143K - > 262143K(262144K)],3.1761780 secs] [时间s:用户= 31.11 sys = 0.02,real = 3.18 secs]
7月18日14:53:02 fwprodcontent03 gc.log:3194.820:[GC [PSYoungGen:0K-> 0K(2752512K)] 2748534K-> 2748534K(10092544K),0.0589010 secs] [次:用户= 0.38 sys = 0.01,real = 0.06秒]
7月18日14:53:05 fwprodcontent03 gc.log:3194.879:[Full GC [PSYoungGen:0K-> 0K(2752512K)] [ParOldGen:2748534K-> 2748529K(7340032K)] 2748534K-> 2748529K(10092544K)[PSPermGen:262143K - > 262143K(262144K)],3.0554520秒] [时间:用户= 30.72 sys = 0.03,实际= 3.05秒]...更多.....
提前致谢.
Uwe*_*nus 10
你看过你的gc统计数据了吗?
[Full GC [PSYoungGen: 0K->0K(2752512K)] [ParOldGen: 2748534K->2748529K(7340032K)] 2748534K->2748529K(10092544K) [PSPermGen: 262143K->262143K(262144K)], 3.0554520 secs]
Run Code Online (Sandbox Code Playgroud)
重要的部分是[PSPermGen:262143K-> 262143K(262144K)].您PermGenSpace已经筋疲力尽,因此完成了GC.因此,您可以PermGenSpace进一步解决这个问题(可能通过减少堆空间).
如果不重新启动Tomcat,也不要经常在生产系统上部署,因为这会耗尽你的PermGenSpace速度.
| 归档时间: |
|
| 查看次数: |
2329 次 |
| 最近记录: |