RFR(S): 8209162: Page size selection does not always select optimal page size
Stefan Johansson
stefan.johansson at oracle.com
Tue Apr 21 12:28:16 UTC 2020
On 2020-04-21 13:22, Thomas Schatzl wrote:
> Hi,
>
> On 21.04.20 13:18, Stefan Johansson wrote:
>> Hi Ivan,
>>
>> I'm not very familiar with this code, but one observation. This is a
>> bit similar to what I looked at recently for G1. There the region size
>> was different for a given heap size depending on if Xms was set or
>> not. Here we can run into a situation where the page size differ
>> depending on Xms, and this also feels a bit strange. Would there be a
>> problem to simplify this to a single line and always just care about min:
>> const size_t page_sz = os::page_size_for_region_aligned(MinHeapSize, 4);
>>
>> I'm trying to understand when this would be a problem, but can't think
>> of anything straight away.
>>
>
> the RFE is a suggestion to maximize page sizes when Xms == Xmx. I.e.
> if you do that, you do not care about uncommitting memory, so there is
> no need for being able to uncommit. In this case it is favorable to use
> maximum page size for throughput.
I agree with that, and only looking at MinHeapSize will achieve that,
since for a fixed heap it is the same as MaxHeapSize. I'm just trying to
come up with a case where the min-calculation leads to using a larger
page size than we want so that we need to do the max/8 calculation.
Something like:
-Xmx10m -Xms8m => 4k pages because 10/8 is below 2mb, while 8/4 == 2mb.
Why is this good? I guess it might be good if -Xmx was 9m, but in such
case, wouldn't some other alignment step in and prevent us from using
2mb pages?
Stefan
>
> Thanks,
> Thomas
>
More information about the hotspot-gc-dev
mailing list