comparison src/share/vm/memory/collectorPolicy.cpp @ 17899:9eddc467297f

8035057: NewSize ergonomics wrong when setting small or unaligned size on command line Summary: Making sure that if NewSize is set on the command line it should be used for both min and initial size even if it is re-aligned. Reviewed-by: jwilhelm, jmasa
author sjohanss
date Fri, 21 Feb 2014 09:48:52 +0100
parents 1d01a7f3a336
children 78bbf4d43a14
comparison
equal deleted inserted replaced
17898:1d01a7f3a336 17899:9eddc467297f
305 _initial_heap_byte_size = smallest_heap_size; 305 _initial_heap_byte_size = smallest_heap_size;
306 } 306 }
307 } 307 }
308 308
309 // Now take the actual NewSize into account. We will silently increase NewSize 309 // Now take the actual NewSize into account. We will silently increase NewSize
310 // if the user specified a smaller value. 310 // if the user specified a smaller or unaligned value.
311 smallest_new_size = MAX2(smallest_new_size, (uintx)align_size_down(NewSize, _gen_alignment)); 311 smallest_new_size = MAX2(smallest_new_size, (uintx)align_size_down(NewSize, _gen_alignment));
312 if (smallest_new_size != NewSize) { 312 if (smallest_new_size != NewSize) {
313 FLAG_SET_ERGO(uintx, NewSize, smallest_new_size); 313 // Do not use FLAG_SET_ERGO to update NewSize here, since this will override
314 // if NewSize was set on the command line or not. This information is needed
315 // later when setting the initial and minimum young generation size.
316 NewSize = smallest_new_size;
314 } 317 }
315 _initial_gen0_size = NewSize; 318 _initial_gen0_size = NewSize;
316 319
317 if (!FLAG_IS_DEFAULT(MaxNewSize)) { 320 if (!FLAG_IS_DEFAULT(MaxNewSize)) {
318 uintx min_new_size = MAX2(_gen_alignment, _min_gen0_size); 321 uintx min_new_size = MAX2(_gen_alignment, _min_gen0_size);