The code responsible for determining the heap expansion amount is currently a part of G1CollectorPolicy. This functionality is completely independent of the other pieces of the general collector policy code and could therefore be factored out into a class of its own.
This move keeps the G1CollectorPolicy code mostly responsible for things related to G1 garbage collections. One could of course imagine that there could be situations where the sizing of the heap is influenced by the collector policy but there is nothing preventing that with the new model. The only difference would be that there would be a need for clearer API for such influences.
This move keeps the G1CollectorPolicy code mostly responsible for things related to G1 garbage collections. One could of course imagine that there could be situations where the sizing of the heap is influenced by the collector policy but there is nothing preventing that with the new model. The only difference would be that there would be a need for clearer API for such influences.