@@ -67,7 +67,7 @@ class TestGenCollectorPolicy {
67
67
MinHeapSize = 40 * M;
68
68
FLAG_SET_ERGO (InitialHeapSize, 100 * M);
69
69
FLAG_SET_ERGO (NewSize, 1 * M);
70
- FLAG_SET_ERGO (MaxNewSize, 80 * M);
70
+ FLAG_SET_ERGO (MaxNewSize, 40 * M);
71
71
72
72
ASSERT_NO_FATAL_FAILURE (setter1->execute ());
73
73
@@ -159,10 +159,16 @@ class TestGenCollectorPolicy {
159
159
// depends on so many other configurable variables. These tests only try to
160
160
// verify that there are some basic rules for NewSize honored by the policies.
161
161
162
+ // Tests require at least 128M of MaxHeap
163
+ // otherwise ergonomic is different and generation sizes might be changed.
164
+
162
165
// If NewSize has been ergonomically set, the collector policy
163
166
// should use it for min but calculate the initial young size
164
167
// using NewRatio.
165
168
TEST_VM (CollectorPolicy, young_scaled_initial_ergo) {
169
+ if (MaxHeapSize < 128 * M) {
170
+ return ;
171
+ }
166
172
TestGenCollectorPolicy::SetNewSizeErgo setter (20 * M);
167
173
TestGenCollectorPolicy::CheckScaledYoungInitial checker;
168
174
@@ -175,6 +181,9 @@ TEST_VM(CollectorPolicy, young_scaled_initial_ergo) {
175
181
// the rest of the VM lifetime. This is an irreversible change and
176
182
// could impact other tests so we use TEST_OTHER_VM
177
183
TEST_OTHER_VM (CollectorPolicy, young_cmd) {
184
+ if (MaxHeapSize < 128 * M) {
185
+ return ;
186
+ }
178
187
// If NewSize is set on the command line, it should be used
179
188
// for both min and initial young size if less than min heap.
180
189
TestGenCollectorPolicy::SetNewSizeCmd setter (20 * M);
@@ -187,7 +196,7 @@ TEST_OTHER_VM(CollectorPolicy, young_cmd) {
187
196
188
197
// If NewSize is set on command line, but is larger than the min
189
198
// 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);
192
201
TestGenCollectorPolicy::TestWrapper::test (&setter_large, &checker_large);
193
202
}
0 commit comments