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

Daniel D. Daugherty dcubed at openjdk.org
Sat Jul 1 15:08:06 UTC 2023


On Thu, 1 Jun 2023 09:33:10 GMT, Guoxiong Li <gli at openjdk.org> wrote:

>> Hi all,
>> 
>> When `MaxHeapSize` is equal to `InitialHeapSize` and `NewSize` is set in command line,
>> currently, the `max_young_size/MaxNewSize` will be set to the value of `NewSize`.
>> 
>> Considering the document of the `NewSize` (shown below), someone may set the `NewSize` 
>> to a very small value and expect the JVM to adjust the value dynamically.
>> Then when the `MaxHeapSize` is equal to `InitialHeapSize` (set by user or ergonomics),
>> the `MaxNewSize` is set to the value of `NewSize`, which is small unexpectedly.
>> 
>> 
>>   product(size_t, NewSize, ScaleForWordSize(1*M),                           \
>>           "Initial new generation size (in bytes)")                         \
>>           constraint(NewSizeConstraintFunc,AfterErgo)                       \
>> 
>> 
>> This patch fixes the issue by setting the `MaxNewSize` to `NewSize` only when the `NewSize` 
>> is larger than the original `max_young_size/MaxNewSize`.
>> 
>> The title of JDK-8047998 may need to adjusted.
>> 
>> Thanks for the review.
>> 
>> Best Regards,
>> -- Guoxiong
>
> Guoxiong Li has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Abort the vm instead of setting it implicitly.
>  - Merge branch 'master' into JDK-8047998
>  - JDK-8047998

Two tests are failing many times in Tier2 after [JDK-8047998](https://bugs.openjdk.org/browse/JDK-8047998): 

  10 gc/arguments/TestNewSizeFlags.java 
  10 gc/arguments/TestVerifyBeforeAndAfterGCFlags.java 

so 20 failures per Tier2. 

Three tests are failing many times in Tier3 after [JDK-8047998](https://bugs.openjdk.org/browse/JDK-8047998): 

   4 compiler/runtime/Test8010927.java 
   6 jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java 
   6 jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java 

so 16 failures per Tier3.

This fix has been backed out via:

[JDK-8311215](https://bugs.openjdk.org/browse/JDK-8311215) [BACKOUT] JDK-8047998 Abort the vm if MaxNewSize is not the same as NewSize when MaxHeapSize is the same as InitialHeapSize

and the following bug created to track the failures caused by the original
JDK-8047998 and to use as a [REDO]:

[JDK-8311214](https://bugs.openjdk.org/browse/JDK-8311214) [REDO] JDK-8047998 Abort the vm if MaxNewSize is not the same as NewSize when MaxHeapSize is the same as InitialHeapSize

Before this work is reintegrated, please make sure that someone runs the
revised fix thru Mach5 Tier2 and Tier3 testing (at a minimum).

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

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


More information about the hotspot-gc-dev mailing list