右岸天晴 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.

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog