--- old/src/share/vm/memory/collectorPolicy.cpp 2014-06-13 03:58:11.000000000 -0400 +++ new/src/share/vm/memory/collectorPolicy.cpp 2014-06-13 03:58:11.000000000 -0400 @@ -392,7 +392,7 @@ uintx calculated_size = NewSize + OldSize; double shrink_factor = (double) MaxHeapSize / calculated_size; uintx smaller_new_size = align_size_down((uintx)(NewSize * shrink_factor), _gen_alignment); - FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), smaller_new_size)); + FLAG_SET_ERGO(uintx, NewSize, MAX2(young_gen_size_lower_bound(), (size_t)smaller_new_size)); _initial_young_size = NewSize; // OldSize is already aligned because above we aligned MaxHeapSize to @@ -457,7 +457,7 @@ // yield a size that is too small) and bound it by MaxNewSize above. // Ergonomics plays here by previously calculating the desired // NewSize and MaxNewSize. - _max_young_size = MIN2(MAX2(_max_young_size, _initial_young_size), MaxNewSize); + _max_young_size = MIN2(MAX2(_max_young_size, _initial_young_size), (size_t)MaxNewSize); } // Given the maximum young size, determine the initial and @@ -487,7 +487,7 @@ // NewSize as the floor, because if NewRatio is overly large, the resulting // size can be too small. _initial_young_size = - MIN2(_max_young_size, MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize)); + MIN2(_max_young_size, MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), (size_t)NewSize)); } }