MaxTenuringThreshold调优明显减少系统FGC次数(线上JVM排查之七)

Posted 深度Java

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MaxTenuringThreshold调优明显减少系统FGC次数(线上JVM排查之七)相关的知识,希望对你有一定的参考价值。

背景:因为MaxTenuringThreshold设置不合理,导致年轻代的对象很快进入年老代,导致年老代FGC频率增加,进而影响系统性能。

线上某服务一直存在FGC比较严重的情况,排查下来是MaxTenuringThreshold=3.

当一个对象在新生代中经历过Minor GC之后对象的年龄就+1,原来0岁此时就变为1了,当再经历一次回收之后依然没有被回收则年龄就变为2,而我们给这参数设置的最大参数为3,假如对象的年龄变为4超些我们设置的最大的这个3时,该对象就会从新生代晋升到老年代当中。

.看Oracle官方的说明:

Do Not Set -XX:MaxTenuringThreshold to a Value Greater Than 15

Last updated on APRIL 18, 2021

APPLIES TO:
Java SE JDK and JRE - Version 1.5.0 and later
Information in this document applies to any platform.
SYMPTOMS
When tuning the Java garbage collector (GC), so called \'survivor spaces\' can be configured to "age" new objects. This can reduce fragmentation in the old space of the heap, particularly whe

以上是关于MaxTenuringThreshold调优明显减少系统FGC次数(线上JVM排查之七)的主要内容,如果未能解决你的问题,请参考以下文章

MaxTenuringThreshold调优明显减少系统FGC次数(线上JVM排查之七)

MaxTenuringThreshold调优明显减少系统FGC次数(线上JVM排查之七)

JVM调优参数

Java性能调优

JVM调优推荐

JVM参数列表--jvm调优