--- old/src/share/vm/gc_implementation/g1/g1Allocator.cpp 2015-04-07 20:38:38.829789108 +0400 +++ new/src/share/vm/gc_implementation/g1/g1Allocator.cpp 2015-04-07 20:38:38.749789115 +0400 @@ -119,7 +119,6 @@ size_t gclab_word_size = _g1h->desired_plab_sz(dest); if (word_sz * 100 < gclab_word_size * ParallelGCBufferWastePct) { G1ParGCAllocBuffer* alloc_buf = alloc_buffer(dest, context); - add_to_alloc_buffer_waste(alloc_buf->words_remaining()); alloc_buf->retire(); HeapWord* buf = _g1h->par_allocate_during_gc(dest, gclab_word_size, context); @@ -153,7 +152,8 @@ for (uint state = 0; state < InCSetState::Num; state++) { G1ParGCAllocBuffer* const buf = _alloc_buffers[state]; if (buf != NULL) { - add_to_alloc_buffer_waste(buf->words_remaining()); + add_to_alloc_buffer_waste(buf->wasted()); + add_to_undo_waste(buf->undo_wasted()); buf->flush_and_retire_stats(_g1h->alloc_buffer_stats(state)); } }