RFR: 8284900: Check InitialHeapSize and container memory limits before startup [v8]
Ioi Lam
iklam at openjdk.java.net
Thu Apr 21 17:56:25 UTC 2022
On Thu, 21 Apr 2022 12:39:12 GMT, David Holmes <dholmes at openjdk.org> wrote:
>>> @jerboaa Good point. Also take a look at Arguments::set_heap_size() and how that function uses os::physical_memory() and also limit_heap_by_allocatable_memory(). It seems like any change in GCArguments should go hand-in-hand with the code in set_heap_size.
>>
>> +1
>
> I agree with the comments that this should behave exactly as it would for a physical machine. The fact we are in a container is not really relevant.
Maybe we ought to move the check into arguments.cpp, and compare os::physical_memory against (initial heap size + initial code cache size + .... something else)?
Forcing the VM to quit may have backward compatibility issues, though. Some apps may set their -Xms to be larger than the container memory limit, but they may use so little heap memory that the VM never commits enough memory to trigger the OOM killer. With this PR those apps will suddenly start failing.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8256
More information about the hotspot-gc-dev
mailing list