--- old/src/share/vm/gc/g1/g1Allocator.cpp 2015-08-17 17:07:17.771853035 +0200 +++ new/src/share/vm/gc/g1/g1Allocator.cpp 2015-08-17 17:07:17.692850669 +0200 @@ -232,7 +232,7 @@ AllocationContext_t context, bool* plab_refill_failed) { size_t plab_word_size = G1CollectedHeap::heap()->desired_plab_sz(dest); - size_t required_in_plab = word_sz + PLAB::alignment_reserve(); + size_t required_in_plab = PLAB::size_required_for_allocation(word_sz); // Only get a new PLAB if the allocation fits and it would not waste more than // ParallelGCBufferWastePct in the existing buffer. @@ -245,13 +245,12 @@ HeapWord* buf = _allocator->par_allocate_during_gc(dest, plab_word_size, context); if (buf != NULL) { // Otherwise. - alloc_buf->set_word_size(plab_word_size); - alloc_buf->set_buf(buf); + alloc_buf->set_buf(buf, plab_word_size); HeapWord* const obj = alloc_buf->allocate(word_sz); assert(obj != NULL, err_msg("PLAB should have been big enough, tried to allocate " - SIZE_FORMAT " with alignment reserve " SIZE_FORMAT " PLAB size " SIZE_FORMAT, - word_sz, PLAB::alignment_reserve(), plab_word_size)); + SIZE_FORMAT " requiring " SIZE_FORMAT " PLAB size " SIZE_FORMAT, + word_sz, required_in_plab, plab_word_size)); return obj; } // Otherwise.