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

Zhengyu Gu zgu at openjdk.org
Mon Apr 22 14:31:28 UTC 2024


On Mon, 22 Apr 2024 14:24:24 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> Hmmm, setting `initial_old_size = MaxOldSize` fails `gtest` again:
>> 
>> [----------] 4 tests from CollectorPolicy
>> [ RUN      ] CollectorPolicy.young_min_ergo_vm
>> [       OK ] CollectorPolicy.young_min_ergo_vm (0 ms)
>> [ RUN      ] CollectorPolicy.young_scaled_initial_ergo_vm
>> [       OK ] CollectorPolicy.young_scaled_initial_ergo_vm (0 ms)
>> [ RUN      ] CollectorPolicy.young_cmd_other_vm
>> [       OK ] CollectorPolicy.young_cmd_other_vm (79 ms)
>> [ RUN      ] CollectorPolicy.old_cmd_other_vm
>> [0.050s][warning][gc,ergo] Inconsistency between initial old size and minimum old size
>> [0.050s][warning][gc,ergo] Inconsistency between generation sizes and heap size, resizing the generations to fit the heap.
>> /Users/zhengyu.gu/ws/jdk/test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp:261: Failure
>> Death test: child_CollectorPolicy_old_cmd_()
>>     Result: died but not with expected exit code:
>>             Terminated by signal 6
>> Actual msg:
>> [  DEATH   ] 
>> [  DEATH   ] [ FATAL ] /Users/zhengyu.gu/ws/googletest-1.14.0/googletest/include/gtest/internal/gtest-port.h:1710:: pthread_mutex_destroy(&mutex_)failed with error 16
>> [  DEATH   ] 
>> 
>> [  FAILED  ] CollectorPolicy.old_cmd_other_vm (78 ms)
>> [----------] 4 tests from CollectorPolicy (158 ms total)
>
> Maybe my prev msg was misleading... Reprint the code-snippet:
> 
> 
>     if (initial_old_size > MaxOldSize) {
>       log_warning(gc, ergo)(...);
>       initial_old_size = MaxOldSize;
>     } else if (initial_old_size < MinOldSize) {
>       log_waring(gc, ergo)(...);
>       initial_old_size = MinOldSize;
>     }
> 
> so that the two assignment to `initial_old_size` matches up, accounting for over/under flow.

Sorry, my typo in above comment. I did set `initial_old_size = MinOldSize`.


@@ -308,7 +308,7 @@ void GenArguments::initialize_size_info() {
       initial_old_size = MaxOldSize;
     } else if (initial_old_size < MinOldSize) {
       log_warning(gc, ergo)("Inconsistency between initial old size and minimum old size");
-      MinOldSize = initial_old_size;
+      initial_old_size = MinOldSize;
     }
   }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18539#discussion_r1574857628


More information about the hotspot-gc-dev mailing list