RFR: 8284900: Check InitialHeapSize and container memory limits before startup [v5]

Stefan Karlsson stefank at openjdk.java.net
Tue Apr 19 11:38:33 UTC 2022


On Tue, 19 Apr 2022 07:50:17 GMT, xpbob <duke at openjdk.java.net> wrote:

>> Check InitialHeapSize and container memory limits before startup
>> 
>> 
>> Operating System Metrics:
>>     Provider: cgroupv1
>>     Effective CPU Count: 8
>>     CPU Period: 100000us
>>     CPU Quota: -1
>>     CPU Shares: -1
>>     List of Processors, 8 total: 
>>     0 1 2 3 4 5 6 7 
>>     List of Effective Processors: N/A
>>     List of Memory Nodes, 1 total: 
>>     0 
>>     List of Available Memory Nodes: N/A
>>     Memory Limit: 50.00M
>>     Memory Soft Limit: Unlimited
>>     Memory & Swap Limit: 60.00M
>>     Maximum Processes Limit: 4194305
>> 
>> command:-Xms60m -XshowSettings:system -version 
>> 
>> 
>> 
>> 
>> When the memory limit is exceeded, the startup fail with message
>> 
>> 
>> 
>> Error occurred during initialization of VM
>> Initial heap size set to a larger value than the container memory & swap limit
>
> xpbob has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Optimize the code

Changes requested by stefank (Reviewer).

src/hotspot/share/gc/shared/gcArguments.cpp line 35:

> 33: #if defined(LINUX)
> 34: #include "osContainer_linux.hpp"
> 35: #endif

The conditional includes are usually put after all the other includes. Could you move this?

src/hotspot/share/gc/shared/gcArguments.cpp line 139:

> 137:     }
> 138:   }
> 139: #endif

The current code is structured with carefully added newlines to aid readability. This patch removes one of those newlines, and replace it with this block. Could you keep the current format and add code as a separate block with newlines before and after? Maybe also consider moving this to after the more primitive checks in 140-149?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8256



More information about the hotspot-gc-dev mailing list