Profile Image
vishnupriya

What is JVM startup parameter: -XX:[+|-]UseAdaptiveSizePolicy?

What is JVM startup parameter: -XX:[+|-]UseAdaptiveSizePolicy? 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-useadaptivesizepolicy

  • x-useadaptivesizepolicy

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:                                                    

 

The option “UseAdaptiveSizePolicy” enables the built-in tuning with the default throughput/parallel scavenge collector default throughput/parallel scavenge collector.

 

Since:

 

Starting from JDK 6.

 

Syntax:

 

java -XX:[+|-]UseAdaptiveSizePolicy MainClass

 

Examples:

  • To enable adaptive generation sizing: java -XX:+UseAdaptiveSizePolicy MainClass
  • To disable adaptive generation sizing: java -XX:-UseAdaptiveSizePolicy MainClass

Description:

 

This option is defined as part of the hotspot ergonomics and can be specified with throughput or dwell time priority. If it is turned on, the "Adaptive Size Policy" will change heap generation sizes dynamically to meet the following goals sequentially:

 

  • Latency Goal - Reduce application pauses below a desired level.
  • Throughput Goal - Increase the ratio of application execution time over pause time above a desired level.
  • Footprint Goal - Reduce the heap size as low as possible.

 

The "Adaptive Size Policy" uses the following simple approach to meet above goals:

 

  • Step 1 - Try to meet the Latency Goal: Check the application pause time. If it is greater than the desired level, then reduce the generations sizes to reduce application pause time.
  • Step 2 - Try to meet the Throughput Goal: Check the ratio of application execution time over pause time, if the Latency goal is being met. If the ratio of application execution time over pause time is lower than the desired level, then increase the generation sizes to increase application execution time.
  • Step 3 - Try to meet the Footprint Goal: If both Latency goal and Throughput goal are being met, then generation sizes to reduce heap memory footprint.

Default Value:

 

By default, it is enabled by default in any recent version of the JVM except for the following cases:

  • UseConcMarkSweepGC and UseParNewGC (OpenJDK)
  • Definition of SurvivorRatio

The CMS algorithm is therefore not compatible with Ergonomics for all JVMs:

  • Incomplete compatibility: OpenJDK (instability issue)
  • Compatibility: Apple, …

Errors:

 

None.

 

Related Posts:

Got something else on mind? Post Your Question

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

  • xx-useadaptivesizepolicy

  • x-useadaptivesizepolicy

  • JVM startup parameter