Why does the JVM of these Tomcat servers perform a full GC hourly?

前端 未结 2 1950
情深已故
情深已故 2021-02-01 04:03

We run many Tomcat servers and have observed full garbage collections (GCs) are often performed on an hourly basis, particularly when memory usage is relatively low. The precise

2条回答
  •  执念已碎
    2021-02-01 04:28

    Your "regular" hourly GCs are probably due to this known bug, "The JreMemoryLeakPreventionListener causes a full GC every hour when gcDaemonProtection=true".

    Confirm your Tomcat versions and the value of the gcDaemonProtection property of your JreMemoryLeakPreventionListener (default is true).

    The patch was purportedly included in Tomcat v.7.0.28+ and v.6.0.36+.

    Either upgrade your server(s), or choose a non-upgrading solution from here, summarized as:

    1. suppress full garbage collections using JVM arg -XX:+DisableExplicitGC
    2. keep the full GCs, but defer to the CMS collector using JVM arg -XX:+ExplicitGCInvokesConcurrent
    3. set
    4. Disable the listener

    Credit where credit is due; I obtained my initial answer from here.

提交回复
热议问题