Usage:
This flag allows you to add conservatism when computing the duty cycle:
-XX:CMSIncrementalSafetyFactor=percent , where percent is the desired value in %.
Since:
Starting from JDK 6.
Deprecated:
Starting from JDK 8.
Examples:
This will instruct JVM to add 50% of conservatism:
-XX:CMSIncrementalSafetyFactor=50
Description:
Before talking about the flag, we need to introduce Garbage Collector (GC) and Concurrent Mark Sweep (CMS):
Garbage Collector is a way of the JVM to clean the memory and makes the java memory more efficient. It tracks (Mark step) and removes (sweep step) every unused object available in the JVM heap space. An object is considered unused when it’s referenced by null, assigned to another reference or by anonymous object …. There are 5 type of GC implementations:
- Serial Garbage Collector
- Parallel Garbage Collector
- CMS Garbage Collector
- G1 Garbage Collector
- Z Garbage Collector
CMS Garbage Collector, as mentioned above, is one of the implementations of GC, which uses multiple thread for garbage collection. It’s created for applications that favor shorter garbage collection pauses and that can afford to share processor resources with the garbage collector while the application is running. It achieves long pauses by two ways:
- By using free lists to manage reclaimed space instead of compacting the Old Generation.
- By doing mainly the job in Mark (marking a reference) and Sweep (removing the marked reference) process simultaneously with the application. Which means that the GC is not stopping or freezing the application’s threads to do its job. But it does take part of using the CPU time with the application. By default, GC algorithm can use number of threads up to ¼ of the number of physical cores of your machine.
Hence, the concurrent garbage collector has a safety factor which is added to the duty cycle when it decides how to pace the collection. This flag allows you to set the percentage of time (0 to 100) used to add conservatism when computing the duty cycle. Setting a large number means that more time will be given to a minor collection.
This option was deprecated in JDK 8 with no replacement, following the deprecation of the -XX:+CMSIncrementalMode option. The option was removed, because the entire incremental mode was removed.
Default Value:
Default is 10%.
Note:
If this flag doesn’t help you, you can use the flag “CMSIncrementalDutyCycleMin=value” which will increase the minimum of duty cycle itself. Where value is between 0 and 100. A higher number means increasing the minimum time to give to a minor collection.
Errors:
The value should be a range between 0 and 100.
Arguments related:
CMSInitiatingOccupancyFraction, CMSScavengeBeforeRemark, CMSClassUnloadingEnabled, CMSScavengeBeforeRemark, CMSIncrementalSafetyFactor, UseCMSInitiatingOccupancyOnly, CMSPermGenSweepingEnabled, UseConcMarkSweepGC, CMSIncrementalMode and CMSIncrementalDutyCycleMin
Related Posts:
Edit your Comment