# HG changeset patch # User tonyp # Date 1326171041 18000 # Node ID 97c00e21fecb4c6526d0dc003b981ce7cd0793ea # Parent 02838862dec83d4b0bfdb9dbdd3679dc672ac35f 7125281: G1: heap expansion code is replicated Reviewed-by: brutisso, johnc diff -r 02838862dec8 -r 97c00e21fecb src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Sat Jan 07 00:43:59 2012 -0500 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Mon Jan 09 23:50:41 2012 -0500 @@ -3793,6 +3793,8 @@ size_t expand_bytes = g1_policy()->expansion_amount(); if (expand_bytes > 0) { size_t bytes_before = capacity(); + // No need for an ergo verbose message here, + // expansion_amount() does this when it returns a value > 0. if (!expand(expand_bytes)) { // We failed to expand the heap so let's verify that // committed/uncommitted amount match the backing store @@ -3849,21 +3851,6 @@ // CM reference discovery will be re-enabled if necessary. } - { - size_t expand_bytes = g1_policy()->expansion_amount(); - if (expand_bytes > 0) { - size_t bytes_before = capacity(); - // No need for an ergo verbose message here, - // expansion_amount() does this when it returns a value > 0. - if (!expand(expand_bytes)) { - // We failed to expand the heap so let's verify that - // committed/uncommitted amount match the backing store - assert(capacity() == _g1_storage.committed_size(), "committed size mismatch"); - assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch"); - } - } - } - // We should do this after we potentially expand the heap so // that all the COMMIT events are generated before the end GC // event, and after we retire the GC alloc regions so that all