RFR: 8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx [v9]

Guoxiong Li gli at openjdk.org
Tue Apr 30 15:16:07 UTC 2024


On Wed, 24 Apr 2024 14:36:44 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:

>> Parallel GC resizes old gen even when setting -Xms == -Xmx. 
>> 
>> During GC argument setup, it always set `MinOldSize = GenAlignment` and does not make any adjustment when `-Xms == -Xmx`, while does the adjustment for young gen [here](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/gc/shared/genArguments.cpp#L250)
>
> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reverse previous change

Looks good. Two nits/questions.

src/hotspot/share/gc/shared/genArguments.cpp line 311:

> 309:     } else if (initial_old_size < MinOldSize) {
> 310:       log_warning(gc, ergo)("Inconsistency between initial old size and minimum old size");
> 311:       MinOldSize = initial_old_size;

The comment shown below seems strange. Can it be removed?
```C++
    // The generation minimums and the overall heap minimum should
    // be within one generation alignment.



The warning message shown below can be more consistent with this newly added one. 
```C++
      log_warning(gc, ergo)("Inconsistency between maximum heap size and maximum "
                            "generation sizes: using maximum heap = " SIZE_FORMAT
                            ", -XX:OldSize flag is being ignored",
                            MaxHeapSize);

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

Changes requested by gli (Committer).

PR Review: https://git.openjdk.org/jdk/pull/18539#pullrequestreview-2031703711
PR Review Comment: https://git.openjdk.org/jdk/pull/18539#discussion_r1585004154


More information about the hotspot-gc-dev mailing list