You can enable/disable step-by-step heap shrinking with:
-XX:ShrinkHeapInSteps=[true,false], where you can choose either true or false value
Will disable this option and commands JVM to shrink heap in one cycle:
Incrementally reduces the Java heap to the target size, specified by the option -XX:MaxHeapFreeRatio. This option is enabled by default. If disabled, then it immediately reduces the Java heap to the target size instead of requiring multiple garbage collection cycles. Disable this option if you want to minimize the Java heap size. You will likely encounter performance degradation when this option is disabled.
Default value is true
TODO link –XX:MaxHeapFreeRatio
If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.