--- old/src/share/vm/gc/g1/g1Allocator.cpp 2015-08-24 15:33:10.827670613 +0200 +++ new/src/share/vm/gc/g1/g1Allocator.cpp 2015-08-24 15:33:10.747668223 +0200 @@ -144,8 +144,12 @@ HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, size_t word_size, AllocationContext_t context) { - size_t temp; - return par_allocate_during_gc(dest, word_size, word_size, &temp, context); + size_t temp = 0; + HeapWord* result = par_allocate_during_gc(dest, word_size, word_size, &temp, context); + assert(result == NULL || temp == word_size, + err_msg("Requested " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT, + word_size, temp, p2i(result))); + return result; } HeapWord* G1Allocator::par_allocate_during_gc(InCSetState dest, @@ -264,12 +268,17 @@ G1PLAB* alloc_buf = alloc_buffer(dest, context); alloc_buf->retire(); - size_t actual_plab_size; + size_t actual_plab_size = 0; HeapWord* buf = _allocator->par_allocate_during_gc(dest, required_in_plab, plab_word_size, &actual_plab_size, context); + + assert(buf == NULL || ((actual_plab_size >= required_in_plab) && (actual_plab_size <= plab_word_size)), + err_msg("Requested at minimum " SIZE_FORMAT ", desired " SIZE_FORMAT " words, but got " SIZE_FORMAT " at " PTR_FORMAT, + required_in_plab, plab_word_size, actual_plab_size, p2i(buf))); + if (buf != NULL) { alloc_buf->set_buf(buf, actual_plab_size);