RFR: 8047998: Abort the vm if MaxNewSize is not the same as NewSize when MaxHeapSize is the same as InitialHeapSize

Guoxiong Li gli at openjdk.org
Sun Jun 11 08:00:05 UTC 2023


On Mon, 29 May 2023 11:43:08 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>>> OK, maybe sth along these lines:
>>> 
>>> ```c++
>>> if (MaxHeapSize == InitialHeapSize) {
>>>   if (FLAG_IS_CMDLINE(NewSize) && FLAG_IS_CMDLINE(MaxNewSize) && NewSize != MaxNewSize) {
>>>     vm_exit_during_initialization(...);
>>>   }
>>>   ...
>>> }
>>> ```
>>> 
>>> I think exiting here is fine because this is an impossible constraint to satisfy, variable young-gen size in constant whole-heap setup. What do you think?
>> 
>> The condition `MaxHeapSize == InitialHeapSize` is often meet, I don't think it is good to abort the vm. I do worry that such exiting may break some current online systems, which is unacceptable for us (Do nothing is better to break the online systems). Considering the JDK21 is a LTS version, I don't want to do such breaking change.
>
>> The condition MaxHeapSize == InitialHeapSize is often meet
> 
> True, but additionally specifying both `NewSize` and `MaxNewSize` is uncommon, IMO.
> 
>> I do worry that such exiting may break some current online systems
> 
> Actually, I think it's desirable to fail loudly if the JVM cmd flags contain errors. Hard to say whether this is an error or not, but debugging suboptimal performance (from incorrect heap/generation-size) is much harder. Therefore, notifying developers at jvm-startup when cmd flags can't be satisfied might be appreciated. Again, this setup should be rare.
> 
> (I agree this is subjective.)

@albertnetymk Thanks for creating the CSR. It may be good to mark it as `PROPOSED` now.

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

PR Comment: https://git.openjdk.org/jdk/pull/13876#issuecomment-1586062649


More information about the hotspot-gc-dev mailing list