Skip to content

Commit 3bda46c

Browse files
author
duke
committedAug 28, 2024
Automatic merge of jdk:master into master
2 parents ee1b31f + d08b5bd commit 3bda46c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎test/hotspot/gtest/gc/shared/test_collectorPolicy.cpp

+12-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class TestGenCollectorPolicy {
6767
MinHeapSize = 40 * M;
6868
FLAG_SET_ERGO(InitialHeapSize, 100 * M);
6969
FLAG_SET_ERGO(NewSize, 1 * M);
70-
FLAG_SET_ERGO(MaxNewSize, 80 * M);
70+
FLAG_SET_ERGO(MaxNewSize, 40 * M);
7171

7272
ASSERT_NO_FATAL_FAILURE(setter1->execute());
7373

@@ -159,10 +159,16 @@ class TestGenCollectorPolicy {
159159
// depends on so many other configurable variables. These tests only try to
160160
// verify that there are some basic rules for NewSize honored by the policies.
161161

162+
// Tests require at least 128M of MaxHeap
163+
// otherwise ergonomic is different and generation sizes might be changed.
164+
162165
// If NewSize has been ergonomically set, the collector policy
163166
// should use it for min but calculate the initial young size
164167
// using NewRatio.
165168
TEST_VM(CollectorPolicy, young_scaled_initial_ergo) {
169+
if (MaxHeapSize < 128 * M) {
170+
return;
171+
}
166172
TestGenCollectorPolicy::SetNewSizeErgo setter(20 * M);
167173
TestGenCollectorPolicy::CheckScaledYoungInitial checker;
168174

@@ -175,6 +181,9 @@ TEST_VM(CollectorPolicy, young_scaled_initial_ergo) {
175181
// the rest of the VM lifetime. This is an irreversible change and
176182
// could impact other tests so we use TEST_OTHER_VM
177183
TEST_OTHER_VM(CollectorPolicy, young_cmd) {
184+
if (MaxHeapSize < 128 * M) {
185+
return;
186+
}
178187
// If NewSize is set on the command line, it should be used
179188
// for both min and initial young size if less than min heap.
180189
TestGenCollectorPolicy::SetNewSizeCmd setter(20 * M);
@@ -187,7 +196,7 @@ TEST_OTHER_VM(CollectorPolicy, young_cmd) {
187196

188197
// If NewSize is set on command line, but is larger than the min
189198
// heap size, it should only be used for initial young size.
190-
TestGenCollectorPolicy::SetNewSizeCmd setter_large(80 * M);
191-
TestGenCollectorPolicy::CheckYoungInitial checker_large(80 * M);
199+
TestGenCollectorPolicy::SetNewSizeCmd setter_large(40 * M);
200+
TestGenCollectorPolicy::CheckYoungInitial checker_large(40 * M);
192201
TestGenCollectorPolicy::TestWrapper::test(&setter_large, &checker_large);
193202
}

0 commit comments

Comments
 (0)
Please sign in to comment.