Java:为什么没有使用XX:SurvivorRatio的默认值?

Java:为什么没有使用XX:SurvivorRatio的默认值?,java,garbage-collection,jvm,Java,Garbage Collection,Jvm,如果您查看文档(例如),您会发现XX:surviorratio的默认值为8 如果您检查一个运行中的jvm,该jvm已启动,但没有显式设置surviorRation,则可以看到此默认值: jmap -heap <pid> 但是如果您使用VisualGC检查s1s0的最大大小,您可以看到使用了surviorratio=1 如果显式地以-XX:survivoratio=8启动java程序,则情况会发生变化 那么,为什么要违约呢。未使用的默认值非常令人恼火。关于java性能调优: -XX:

如果您查看文档(例如),您会发现XX:surviorratio的默认值为8

如果您检查一个运行中的jvm,该jvm已启动,但没有显式设置surviorRation,则可以看到此默认值:

jmap -heap <pid>
但是如果您使用VisualGC检查s1s0的最大大小,您可以看到使用了surviorratio=1

如果显式地以-XX:survivoratio=8启动java程序,则情况会发生变化

那么,为什么要违约呢。未使用的默认值非常令人恼火。

关于java性能调优:

-XX:SurvivorRatio=<n> should be used when you want to explicitly size survivor
spaces to manipulate object aging with the concurrent garbage collector, or to
manipulate object aging with the throughput garbage collector when adaptive sizing
is disabled using the command line option -XX:-UseAdaptiveSizePolicy.
-XX:SurvivorRatio=应在您想要显式调整幸存者大小时使用
使用并发垃圾收集器处理对象老化的空间,或
自适应调整大小时,使用吞吐量垃圾收集器处理对象老化
使用命令行选项-XX:-UseAptiveSizePolicy禁用。

因此,除非在我的测试中使用
-XX:-useAptiveSizePolicy

,否则将忽略
-XX:SurvivorRatio
,在Linux x64上使用Java 8,我可以在不使用其他参数的情况下指定
-XX:SurvivorRatio
,并且它可以工作。
-XX:SurvivorRatio=<n> should be used when you want to explicitly size survivor
spaces to manipulate object aging with the concurrent garbage collector, or to
manipulate object aging with the throughput garbage collector when adaptive sizing
is disabled using the command line option -XX:-UseAdaptiveSizePolicy.