Profile Image

What is JVM startup parameter: -XX:+AggressiveOpts?

What is JVM startup parameter: -XX:+AggressiveOpts? Have you used this JVM arguement before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-aggressiveopts

  • x-aggressiveopts

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky


 This flag allows you to use aggressive performance optimization features.




Starting from JDK 6.




Deprecated in JDK11


Obsoleted in JDK12


Expired in JDK13




This will instruct JVM to use NUMA if available:






The flag “AggressiveOpts” enables various experimental performance optimization features that are expected to become default features in future releases. Its main purpose is to improve benchmarks. With time, majority of arguments that affects are integrated or removed. The remaining flags that this flag was affecting is “AutoBoxCacheMax” & “BiasedLockingStartupDelay”.


  • AutoBoxCacheMax: Is where the compiler converts between primitive and boxed types example of int and Integer. Boxing many times can be create a performance issue since the boxed types are immutable. JVM introduced a cache for boxed types which instead of creating a new reference, it will just return the reference of a cached object if the value to be boxed is within a range which is configurable with the command “AutoBoxCacheMax”. By default, the caching for Byte, Integer, Long is between -128 & 127.
  • BiasedLockingStartupDelay: In order to understand this flag, we need to explain what is biased locking optimization. Biased locking optimization purpose is to handle the case where a block of code or a method is synchronized but only one thread is allowed to acquires or release the lock. Biased locking creates an ultra-fast path for the thread to acquire or release the lock while avoiding the expenses of a Compare And Swap (CAS) operation. Here where our flag comes in handy, it sets the duration of time where JVM consider a lock biased.


When enabling the flag “AggressiveOpts” on these two flags, it can reduce the delay from 4 seconds to 500ms. Here is an article which can discuss about the flag benchmarking Java's -XX:+AggressiveOpts: Can it slow you down?.


Default Value:


By default, this flag is disabled and experimental performance features are disabled.


Related Posts:





Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-aggressiveopts

  • x-aggressiveopts

  • JVM startup parameter