Java Sun JRE 1.6u20 上的 -XX:+AggressiveOpts 启用了哪些标志?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2959878/
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-08-13 14:57:05  来源:igfitidea点击:

What flags are enabled by -XX:+AggressiveOpts on Sun JRE 1.6u20?

performancejvmjava

提问by Binil Thomas

From Sun JRE performance tuning whitepaper, -XX:+AggressiveOptsflag is described as:

从 Sun JRE性能调优白皮书 中-XX:+AggressiveOptsflag 被描述为:

Turns on point performance optimizations that are expected to be on by default in upcoming releases. The changes grouped by this flag are minor changes to JVM runtime compiled code and not distinct performance features (such as BiasedLocking and ParallelOldGC). This is a good flag to try the JVM engineering team's latest performance tweaks for upcoming releases. Note: this option is experimental! The specific optimizations enabled by this option can change from release to release and even build to build. You should reevaluate the effects of this option with prior to deploying a new release of Java.

打开预期在即将发布的版本中默认启用的点性能优化。按此标志分组的更改是对 JVM 运行时编译代码的微小更改,而不是明显的性能特性(例如 BiasedLocking 和 ParallelOldGC)。这是一个很好的标志,可以尝试 JVM 工程团队为即将发布的版本进行的最新性能调整。注意:此选项是实验性的!此选项启用的特定优化可能会因版本而异,甚至会因构建而异。在部署新版本的 Java 之前,您应该重新评估此选项的效果。

My performance tests indicate that using -XX:+AggressiveOptsactually helps my application, but since this is marked as experimental I want to be careful with it (I have been burned by it in the past). So, I want to know what flags are enabled by -XX:+AggressiveOptson 1.6u20. Typically I do this by looking at the method Arguments::set_aggressive_opts_flags()in hotspot/src/share/vm/runtime/arguments.cppfile, but I am unable to find the sources to 1.6u20 at http://download.java.net/jdk6/source/.

我的性能测试表明使用-XX:+AggressiveOpts实际上对我的应用程序有帮助,但由于这被标记为实验性我想小心使用它(我过去曾被它烧毁)。所以,我想知道-XX:+AggressiveOpts1.6u20上启用了哪些标志。通常我通过查看文件中的方法Arguments::set_aggressive_opts_flags()来做到这一点hotspot/src/share/vm/runtime/arguments.cpp,但我无法在http://download.java.net/jdk6/source/找到 1.6u20 的来源。

  • Is there some other way to figure out what flags -XX:+AggressiveOptsenable?
  • Where can I get sources to 1.6u20 release?
  • 有没有其他方法可以确定-XX:+AggressiveOpts启用了哪些标志?
  • 我在哪里可以获得 1.6u20 版本的源代码?

采纳答案by valodzka

To check it for particular release:

要检查它的特定版本:

java -XX:-AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version > no_agg
java -XX:+AggressiveOpts -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version > agg

And then make diff (diff -U0 no_agg agg).

然后使差异(diff -U0 no_agg agg)。

For example, jdk 1.7.0_51:

例如,jdk 1.7.0_51:

-     bool AggressiveOpts                           := false           {product}
+     bool AggressiveOpts                           := true            {product}

-     intx AutoBoxCacheMax                           = 128             {C2 product}
+     intx AutoBoxCacheMax                           = 20000           {C2 product}

-     intx BiasedLockingStartupDelay                 = 4000            {product}
+     intx BiasedLockingStartupDelay                 = 500             {product}

-     bool UseFPUForSpilling                         = false           {C2 product}
+     bool UseFPUForSpilling                         = true            {C2 product}

Jdk 1.8.0:

JDK 1.8.0:

-     bool AggressiveOpts                           := false           {product}
+     bool AggressiveOpts                           := true            {product}

-     intx AutoBoxCacheMax                           = 128             {C2 product}
+     intx AutoBoxCacheMax                           = 20000           {C2 product}

-     intx BiasedLockingStartupDelay                 = 4000            {product}
+     intx BiasedLockingStartupDelay                 = 500             {product}

-     bool EliminateAutoBox                          = false           {C2 product}
+     bool EliminateAutoBox                          = true            {C2 product}

-     bool UseFPUForSpilling                         = false           {C2 product}
+     bool UseFPUForSpilling                         = true            {C2 product}

回答by Benjamin Darfler

Check out this blog post to find out without needing to dive into the code. http://q-redux.blogspot.com/2011/01/inspecting-hotspot-jvm-options.html

查看这篇博文,无需深入研究代码即可找到答案。http://q-redux.blogspot.com/2011/01/inspecting-hotspot-jvm-options.html