Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.28k
stars
720
forks
source link
Make `-Xmnx` proportional to `-Xsoftmx` in Balanced GC #13543
With the existing balanced GC eden sizing logic (and even with changes introduced in https://github.com/eclipse-openj9/openj9/pull/12043) , if a user specifies -Xmx10G -Xmnx5G -Xsoftmx2G, then the -xmnx being used by the eden sizing logic will be 5G.
In Gencon, as of https://github.com/eclipse/omr/pull/6141, this behaviour has been modified, such that the actual maximum amount of space used by nursery, is proportional to -Xmnx/-Xmx - That is, (using the example above), nursery will be allowed to use 50% (5G / 10G) of 2G softmx limit - or in other words, nursery can grow up to 1G. If softmx were to dynamically change to 8G, then nursery can grow up to 4G (again, 50% of softmx value).
In a more mathematical sense, actual max nursery size = (-xmnx/-xmx) * -xsoftmx
The behaviour in Balanced GC should be made consistent with the behaviour of Gencon, such that Eden size is proportional to the softmx in use.
Please note the following:
If -Xmnx or -Xmn have been specified, the the formula given above should be used. If -Xmnx or -Xmnhave not been specified, the formula may still be used, but 0.75 should be used instead of (-xmnx/-xmx)
Balanced GC default maximum and minimum values for eden size (as of https://github.com/eclipse-openj9/openj9/pull/12043), are drastically different than gencon. By default, eden can be anywhere between 1 region, and 75% of the max heap size in use. If no -Xmnx/-Xmn value has been specified, then eden should be allowed to use up to 75% of softmx value, and continue to be 75% of the softmx value if softmx changes dynamically.
The max/min eden size calculation in https://github.com/eclipse-openj9/openj9/pull/12043 , is done in MM_SchedulingDelegate::initialize(), and values _minEdenRegionCount and _maxEdenRegionCount are later consumed in MM_SchedulingDelegate::adjustIdealEdenRegionCount()
The documentation changes related to the new gencon and balanced behaviours are found in the following doc issue: https://github.com/eclipse-openj9/openj9-docs/issues/834 . The documentation here should be changed appropriately once the new behaviour for balanced GC is implemented.
With the existing balanced GC eden sizing logic (and even with changes introduced in https://github.com/eclipse-openj9/openj9/pull/12043) , if a user specifies
-Xmx10G -Xmnx5G -Xsoftmx2G
, then the-xmnx
being used by the eden sizing logic will be5G
.In Gencon, as of https://github.com/eclipse/omr/pull/6141, this behaviour has been modified, such that the actual maximum amount of space used by nursery, is proportional to
-Xmnx
/-Xmx
- That is, (using the example above), nursery will be allowed to use 50% (5G / 10G) of 2G softmx limit - or in other words, nursery can grow up to 1G. If softmx were to dynamically change to 8G, then nursery can grow up to 4G (again, 50% of softmx value). In a more mathematical sense,actual max nursery size = (-xmnx/-xmx) * -xsoftmx
The behaviour in Balanced GC should be made consistent with the behaviour of Gencon, such that Eden size is proportional to the softmx in use.
Please note the following:
-Xmnx
or-Xmn
have been specified, the the formula given above should be used. If-Xmnx
or-Xmn
have not been specified, the formula may still be used, but 0.75 should be used instead of(-xmnx/-xmx)
-Xmnx
/-Xmn
value has been specified, then eden should be allowed to use up to 75% ofsoftmx
value, and continue to be 75% of the softmx value if softmx changes dynamically.MM_SchedulingDelegate::initialize()
, and values_minEdenRegionCount
and_maxEdenRegionCount
are later consumed inMM_SchedulingDelegate::adjustIdealEdenRegionCount()