MaxTenuringThreshold与阈值的动态调整详解
-XX:+PrintCommandLineFlags
-XX:+MaxTenuringThrehold=5
-XX:+PrintTenuringDistribution
实例:
-verbose:gc
-Xms20M
-Xmx20M
-Xmn10M
-XX:+PrintGCDetails
-XX:SurvivorRatio=8
-XX:+PrintCommandLineFlags
-XX:MaxTenuringThreshold=5
-XX:+PrintTenuringDistribution
public class MyTest3 {
public static void main(String[] args) {
int size = 1024 * 1024;
byte[] myAlloc1 = new byte[2 * size];
byte[] myAlloc2 = new byte[2 * size];
byte[] myAlloc3 = new byte[2 * size];
byte[] myAlloc4 = new byte[2 * size];
System.out.println("hello world");
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200527082223964.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwNTc0MzA1,size_16,color_FFFFFF,t_70)