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
UseAdaptiveSizePolicy and other jvm opts
提问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:+UseAdaptiveSizePolicy
is 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:
但是,这里有一堆文章:
- http://download.oracle.com/javase/1.5.0/docs/guide/vm/gc-ergonomics.html
- http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
- http://developers.sun.com/mobility/midp/articles/garbagecollection2/
- http://download.oracle.com/javase/1.5.0/docs/guide/vm/gc-ergonomics.html
- http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html
- http://developers.sun.com/mobility/midp/articles/garbagecollection2/
In most cases, however, if you're tuning SurvivorRatio
will want to tune NewSize
and MaxNewSize
.
在大多数情况下,但是,如果你调整SurvivorRatio
将需要调整NewSize
和MaxNewSize
。
回答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 -heap
if 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) [...]