@@ -78,7 +78,7 @@ class TestGenCollectorPolicy {
78
78
FLAG_SET_ERGO (size_t , InitialHeapSize, 100 * M);
79
79
FLAG_SET_ERGO (size_t , OldSize, 4 * M);
80
80
FLAG_SET_ERGO (size_t , NewSize, 1 * M);
81
- FLAG_SET_ERGO (size_t , MaxNewSize, 80 * M);
81
+ FLAG_SET_ERGO (size_t , MaxNewSize, 40 * M);
82
82
Arguments::set_min_heap_size (40 * M);
83
83
84
84
ASSERT_NO_FATAL_FAILURE (setter1->execute ());
@@ -227,10 +227,16 @@ TEST_VM(CollectorPolicy, young_min_ergo) {
227
227
TestGenCollectorPolicy::TestWrapper::test (&setter, &checker);
228
228
}
229
229
230
+ // Tests require at least 128M of MaxHeap
231
+ // otherwise ergonomic is different and generation sizes might be changed.
232
+
230
233
// If NewSize has been ergonomically set, the collector policy
231
234
// should use it for min but calculate the initial young size
232
235
// using NewRatio.
233
236
TEST_VM (CollectorPolicy, young_scaled_initial_ergo) {
237
+ if (MaxHeapSize < 128 * M) {
238
+ return ;
239
+ }
234
240
TestGenCollectorPolicy::SetNewSizeErgo setter (20 * M);
235
241
TestGenCollectorPolicy::CheckScaledYoungInitial checker;
236
242
@@ -243,6 +249,9 @@ TEST_VM(CollectorPolicy, young_scaled_initial_ergo) {
243
249
// the rest of the VM lifetime. This is an irreversible change and
244
250
// could impact other tests so we use TEST_OTHER_VM
245
251
TEST_OTHER_VM (CollectorPolicy, young_cmd) {
252
+ if (MaxHeapSize < 128 * M) {
253
+ return ;
254
+ }
246
255
// If NewSize is set on the command line, it should be used
247
256
// for both min and initial young size if less than min heap.
248
257
TestGenCollectorPolicy::SetNewSizeCmd setter (20 * M);
@@ -255,8 +264,8 @@ TEST_OTHER_VM(CollectorPolicy, young_cmd) {
255
264
256
265
// If NewSize is set on command line, but is larger than the min
257
266
// heap size, it should only be used for initial young size.
258
- TestGenCollectorPolicy::SetNewSizeCmd setter_large (80 * M);
259
- TestGenCollectorPolicy::CheckYoungInitial checker_large (80 * M);
267
+ TestGenCollectorPolicy::SetNewSizeCmd setter_large (40 * M);
268
+ TestGenCollectorPolicy::CheckYoungInitial checker_large (40 * M);
260
269
TestGenCollectorPolicy::TestWrapper::test (&setter_large, &checker_large);
261
270
}
262
271
0 commit comments