java UseAdaptiveSizePolicy 和其他 jvm 选项

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3634465/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 02:44:50  来源:igfitidea点击:

UseAdaptiveSizePolicy and other jvm opts

javajvm

提问by Anna

The JVM option -XX:+UseAdaptiveSizePolicy is defined as part of the hotspot ergonomics and can be specified with throughput or the pause time priority.

JVM 选项 -XX:+UseAdaptiveSizePolicy 被定义为热点人体工程学的一部分,可以指定吞吐量或暂停时间优先级。

However, my question is - is it right to have the other jvm options like NewSize and SurvivorRatio mentioned along with it?. What exactly is the impact of doing that?

但是,我的问题是 - 将 NewSize 和 SurvivorRatio 等其他 jvm 选项与它一起提到是否正确?这样做的具体影响是什么?

回答by The Alchemist

Just FYI, -XX:+UseAdaptiveSizePolicyis enabled by defaultin any recent version of the Sun JVM.

仅供参考,在任何最新版本的 Sun JVM 中-XX:+UseAdaptiveSizePolicy默认启用

Also, I found an article:

另外,我找到了一篇文章

Avoid trouble: -XX:SurvivorRatio=option is incompatible with the JVM parameter -XX:+UseAdaptiveSizePolicy. Please use either one according to your situation.

避免故障-XX:SurvivorRatio=选项与 JVM 参数不兼容-XX:+UseAdaptiveSizePolicy。请根据您的情况使用任何一种。

I couldn't find a definitive answer for NewSize, but it appears it sets the initialyoung generation size, not permanent, so it's not mutually exclusive with UseAdaptiveSizePolicy.

我找不到 的明确答案NewSize,但它似乎设置了初始年轻代的大小,而不是永久的,因此它与UseAdaptiveSizePolicy.

However, here's a bunch of articles:

但是,这里有一堆文章:

In most cases, however, if you're tuning SurvivorRatiowill want to tune NewSizeand MaxNewSize.

在大多数情况下,但是,如果你调整SurvivorRatio将需要调整NewSizeMaxNewSize

回答by fglez

My experience with combinations of non-standard options (-X) is that they behave slightly different among JVM versions and platforms.

我对非标准选项 (-X) 组合的经验是它们在 JVM 版本和平台之间的行为略有不同。

If you want to be really sure about which is the result of a set of options, check the real JVM values with jmap -heapif possible, e.g.

如果您想真正确定一组选项的结果,请jmap -heap尽可能检查真实的 JVM 值,例如

Client compiler detected.
JVM version is 1.5.0_14-b03

using thread-local object allocation.
Mark Sweep Compact GC

Heap Configuration:
    MinHeapFreeRatio = 40
    MaxHeapFreeRatio = 70
    MaxHeapSize = 209715200 (200.0MB)
    NewSize = 2228224 (2.125MB)
    MaxNewSize = 4294901760 (4095.9375MB)
    OldSize = 1441792 (1.375MB)
    NewRatio = 8
    SurvivorRatio = 32
    PermSize = 8388608 (8.0MB)
    MaxPermSize = 134217728 (128.0MB)
[...]