-
We have a Java application where we have applied the MinHeapFreeRatio=20 and MaxHeapFreeRatio=40, and using ParallelGC. However some of articles says that, these JVM settings (Min and Max free heap ratio) is not applicable for ParallelGC. However, with JDK8 and with ParallelGC we noticed that free heap ratio were within the limit we had set. However with JDK 11 and with ParallelGC, we are noticing that free heap ratio is not getting honored. https://stackoverflow.com/questions/5355933/encourage-the-jvm-to-gc-rather-than-grow-the-heap We have some confusions around whether ParallelGC with irrespective of JDK version honors these settings or not? are these settings applicable for G1GC and CMS GC? Can you please share your experts views around this query? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The support for Enhancement Request The enhancement was back-ported to JDK 7 and JDK 8. The actual code adding the support is found in the following commit: Git Commit The latest description of the two settings is found on line 1435 of the MinHeapFreeRatio: The minimum percentage of heap free after GC to avoid expansion. For most GCs this applies to the old generation. In G1 and ParallelGC it applies to the whole heap. MaxHeapFreeRatio: The maximum percentage of heap free after GC to avoid shrinking. For most GCs this applies to the old generation. In G1 and ParallelGC it applies to the whole heap. |
Beta Was this translation helpful? Give feedback.
The support for
MinHeapFreeRatio
andMaxHeapFreeRatio
was added to the Parallel Collector on January 29, 2014, in JDK 9 Build 03 by the following enhancement request:Enhancement Request
8028391: Make the Min/MaxHeapFreeRatio flags manageable
"To enable applications to control how and when to allow for more or less GC, the flags
-XX:MinHeapFreeRatio
and-XX:MaxHeapFreeRatio
should be made manageable. Support for these flags should also be implemented in the default parallel collector."The enhancement was back-ported to JDK 7 and JDK 8. The actual code adding the support is found in the following commit:
Git Commit
8028391: Make the Min/MaxHeapFreeRatio flags manageable
"Made the flags Mi…