Tomcat GC问题,求大神帮忙!-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

Tomcat GC问题,求大神帮忙!

a123456678 2016-03-10 11:51:59 1706

参数配置如下:
-Xms1024m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+PrintGCDateStamps -XX:+PrintGCDetails -Xloggc:D:/Server/Tomcat-7.0.63/logs/tomcat_gc.log -XX:+DisableExplicitGC
然后今天突然出现了频繁的Full GC导致tomcat假死了,GC日志如下,求大神看看应该怎样优化啊?
screenshot

云服务器登录 云服务器设置
分享到
取消 提交回答
全部回答(1)
  • a123456678
    2019-07-17 18:57:22

    出现这个问题的原因是tomcat 7的一个默认配置(JreMemoryLeakPreventionListener)

    方法一:可以在JVM启动参数中加入-XX:+DisableExplicitGC来禁止System.gc()。当然这个方法不太好,你也可以用另一种方法:

    方法二:
    在html中:

    Thank you Konstantin and Chris for your attention.

    As stated in the initial post:
    'We have recently deployed tomcat-6.0.28 in our organization and are
    noticing every hour, a Full GC is occurring. The same application,
    same JVM, same JVM args, just a new tomcat release.'

    Using the default JreMemoryLeakPreventionListener configuration that
    has 'gcDaemonProtection=true' will result in 1hr FullGCs using Sun
    1.6 b18, b20 and b21on Solaris and Windows. We've tested and
    successfully 'contained' the FullGC behavior using one of the below
    configurations:

    1) suppress the FullGC using JVM arg -XX:+DisableExplicitGC

    2) keep the FullGC but to defer to the CMS collector using JVM arg
    -XX:+ExplicitGCInvokesConcurrent

    3) gcDaemonProtection="false"/>

    4) Disable the listener altogether

    We've decided to go with option 3.

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

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

相似问题
最新问题