右岸天晴 2015-09-01 03:39 采纳率: 0%
浏览 2436

Tomcat GC问题,求大神帮忙!

参数配置如下:
-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日志如下,求大神看看应该怎样优化啊?
GC日志

  • 写回答

1条回答 默认 最新

  • 「已注销」 2015-09-08 00:14
    关注

    出现这个问题的原因是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.

    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料