# HG changeset patch # User sjohanss # Date 1392972532 -3600 # Node ID 9eddc467297f1928dff4f4e13b1b34bdeb808d23 # Parent 1d01a7f3a3361523c57c2bcb620c1a9f1c5707fb 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 diff -r 1d01a7f3a336 -r 9eddc467297f src/share/vm/memory/collectorPolicy.cpp --- a/src/share/vm/memory/collectorPolicy.cpp Wed Apr 23 11:18:53 2014 +0200 +++ b/src/share/vm/memory/collectorPolicy.cpp Fri Feb 21 09:48:52 2014 +0100 @@ -307,10 +307,13 @@ } // Now take the actual NewSize into account. We will silently increase NewSize - // if the user specified a smaller value. + // if the user specified a smaller or unaligned value. smallest_new_size = MAX2(smallest_new_size, (uintx)align_size_down(NewSize, _gen_alignment)); if (smallest_new_size != NewSize) { - FLAG_SET_ERGO(uintx, NewSize, smallest_new_size); + // Do not use FLAG_SET_ERGO to update NewSize here, since this will override + // if NewSize was set on the command line or not. This information is needed + // later when setting the initial and minimum young generation size. + NewSize = smallest_new_size; } _initial_gen0_size = NewSize;