RFR: 8329223: Parallel: Parallel GC resizes heap even if -Xms = -Xmx [v7]
Albert Mingkun Yang
ayang at openjdk.org
Thu Apr 25 10:02:31 UTC 2024
On Wed, 24 Apr 2024 14:33:38 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>>> github action fails on macosx aarch64 (the same kind of machine I use)
>>
>> Could you debug the failure on your macosx-aarch64 machine to identify how `initial_old_size = MinOldSize` results into the failure? (The error msg in GHA is rather limited.) One can probably print out the value for all related flags, `NewSize`, `OldSize`, `InitialHeapSize`, etc for the problematic case, and launch `java` on the cmdline (without `gtest`) with those flags.
>>
>>> I could not reproduce the failure on Linux
>>
>> My linux works fine as well, just fyi.
>
> Debugging with following command line:
> `make CONF=macosx-aarch64-server-fastdebug run-test TEST=gtest TEST_VM_OPTS="-Xlog:gc+heap=trace"`
>
> With `initial_old_size = MinOldSize` fails this test:
>
> ```
> // If OldSize is set on the command line, it should be used
> // for both min and initial old size if less than min heap.
> TestGenCollectorPolicy::SetOldSizeCmd setter(20 * M);
>
> TestGenCollectorPolicy::CheckOldMin checker_min(20 * M);
> TestGenCollectorPolicy::TestWrapper::test(&setter, &checker_min);
>
>
> Debug output:
>
> [0.001s][trace][gc,heap] Maximum heap size 8589934592
> [0.001s][trace][gc,heap] Initial heap size 536870912
> [0.001s][trace][gc,heap] Minimum heap size 6815736
> [0.008s][debug][gc,heap] Minimum heap 8388608 Initial heap 536870912 Maximum heap 8589934592
> [0.036s][debug][gc,heap] Minimum heap 41943040 Initial heap 109051904 Maximum heap 8589934592
> [0.036s][trace][gc,heap] 1: Minimum young 196608 Initial young 36306944 Maximum young 83886080
> [0.036s][warning][gc,ergo] Inconsistency between initial old size and minimum old size
> [0.036s][warning][gc,ergo] Inconsistency between generation sizes and heap size, resizing the generations to fit the heap.
> [0.036s][trace ][gc,heap] 2: Minimum young 196608 Initial young 67305472 Maximum young 83886080
> [0.036s][trace ][gc,heap] Minimum old 41746432 Initial old 41746432 Maximum old 8506048512
> /Users/zhengyu.gu/ws/jdk/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp:261: Failure
>
>
>
> With `MinOldSize = initial_old_size`
>
> Debug output:
>
>
> [0.001s][trace][gc,heap] Maximum heap size 8589934592
> [0.001s][trace][gc,heap] Initial heap size 536870912
> [0.001s][trace][gc,heap] Minimum heap size 6815736
> [0.007s][debug][gc,heap] Minimum heap 8388608 Initial heap 536870912 Maximum heap 8589934592
> [0.034s][debug][gc,heap] Minimum heap 41943040 Initial heap 109051904 Maximum heap 8589934592
> [0.034s][trace][gc,heap] 1: Minimum young 196608 Initial young 36306944 Maximum young 83886080
> [0.034s][warning][gc,ergo] Inconsistency between initial old size and minimum old size
> [0.034s][warning][gc,ergo] Inconsistency between generation sizes and heap size, resizing the generations to fit the heap.
> [0.034s][trace ][gc,heap] 2: Minimum young 196608 Initial young 83886080 Maximum young 83886080
> [0.034s][trace ][gc,heap] Minimum old 20971520 Initial old 25165824 Maximum old 8506048512
>
>
>
> I will reverse back to `MinOldSize = initial_old_size`
I can see these lines are diff:
[0.036s][trace ][gc,heap] 2: Minimum young 196608 Initial young 67305472 Maximum young 83886080
[0.036s][trace ][gc,heap] Minimum old 41746432 Initial old 41746432 Maximum old 8506048512
vs
[0.034s][trace ][gc,heap] 2: Minimum young 196608 Initial young 83886080 Maximum young 83886080
[0.034s][trace ][gc,heap] Minimum old 20971520 Initial old 25165824 Maximum old 8506048512
Does that mean using values from the problematic case, sth like `-XX:MinHeapSize=41943040 -XX:InitialHeapSize=109051904 -XX:MaxHeapSize=8589934592 -XX:NewSize=67305472 -XX:MaxNewSize=83886080 -XX:OldSize=20m`, one would get failure on launching java from cmdline on macosx-aarch64? (These values from the log are printed after they are adjusted as I read the code, so the actual cmdline flag values might not be diff. If you can reproduce the failure consistently on your box, further instrumenting might be required.)
It's still unclear to how the failure is triggered. Therefore, I can't say whether `MinOldSize = initial_old_size` fixes the issue, or just hides it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18539#discussion_r1579211634
More information about the hotspot-gc-dev
mailing list