RFR: 8190283 - Default heap sizing options select a MaxHeapSize larger than available physical memory in some case
Bob Vandette
bob.vandette at oracle.com
Fri Nov 3 17:15:30 UTC 2017
> On Nov 3, 2017, at 12:42 PM, Bob Vandette <bob.vandette at oracle.com> wrote:
>
> I realized that I didn’t post the webrev on our external server. There was only 1 file changed.
> Here’s the diff:
>
> *** old/src/hotspot/share/runtime/arguments.cpp Fri Nov 3 11:50:07 2017
> --- new/src/hotspot/share/runtime/arguments.cpp Fri Nov 3 11:50:07 2017
>
> *** 2086,2098 ****
> --- 2086,2099 ----
> // If the maximum heap size has not been set with -Xmx,
> // then set it as fraction of the size of physical memory,
> // respecting the maximum and minimum sizes of the heap.
> if (FLAG_IS_DEFAULT(MaxHeapSize)) {
> julong reasonable_max = (julong)((phys_mem * MaxRAMPercentage) / 100);
> if (phys_mem <= (julong)((MaxHeapSize * MinRAMPercentage) / 100)) {
> + const julong reasonable_min = (julong)((phys_mem * MinRAMPercentage) / 100);
> + if (reasonable_min < MaxHeapSize) {
> // Small physical memory, so use a minimum fraction of it for the heap
> ! reasonable_max = (julong)((phys_mem * MinRAMPercentage) / 100);
> ! reasonable_max = reasonable_min;
> } else {
> // Not-small physical memory, so require a heap at least
> // as large as MaxHeapSize
> reasonable_max = MAX2(reasonable_max, (julong)MaxHeapSize);
> }
> Bob
>
>> On Nov 3, 2017, at 11:58 AM, Bob Vandette <bob.vandette at oracle.com> wrote:
>>
>> Please review this simple change that alters the algorithm for selecting the
>> default heap size on low (~100MB) memory environments.
>>
>> This issue is blocking the integration of the container improvements (https://bugs.openjdk.java.net/browse/JDK-8146115 <https://bugs.openjdk.java.net/browse/JDK-8146115>).
>>
>>
>> BUG:
>> https://bugs.openjdk.java.net/browse/JDK-8190283 <https://bugs.openjdk.java.net/browse/JDK-8190283>
>>
>> WEBREV:
>> http://bussund0417.us.oracle.com/export/users/bobv/jdk10hs-base/open/webrev/ <http://bussund0417.us.oracle.com/export/users/bobv/jdk10hs-base/open/webrev/>
>>
>> Bob.
>>
>
More information about the hotspot-dev
mailing list