Integrated: 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
Sat Jul 1 08:04:06 UTC 2023


On Tue, 9 May 2023 03:22:52 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

This pull request has now been integrated.

Changeset: 8abb9f59
Author:    Guoxiong Li <gli at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/8abb9f590f844d098b156b719499bb0447f99759
Stats:     7 lines in 1 file changed: 4 ins; 0 del; 3 mod

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

Reviewed-by: ayang, tschatzl

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

PR: https://git.openjdk.org/jdk/pull/13876


More information about the hotspot-gc-dev mailing list