Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

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.

My performance tests indicate that using -XX:+AggressiveOpts actually 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:+AggressiveOpts on 1.6u20. Typically I do this by looking at the method Arguments::set_aggressive_opts_flags() in hotspot/src/share/vm/runtime/arguments.cpp file, but I am unable to find the sources to 1.6u20 at http://download.java.net/jdk6/source/.

  • Is there some other way to figure out what flags -XX:+AggressiveOpts enable?
  • Where can I get sources to 1.6u20 release?
like image 897
Binil Thomas Avatar asked Jun 02 '10 17:06

Binil Thomas


2 Answers

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).

For example, 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:

-     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}
like image 170
valodzka Avatar answered Oct 26 '22 01:10

valodzka


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

like image 42
Benjamin Darfler Avatar answered Oct 25 '22 23:10

Benjamin Darfler