8067339: PLAB reallocation might result in failure to allocate object in that recently allocated PLAB

Properly size the PLAB to make sure that the object to allocate always has enough space in it.

Reviewed-by: mgerdin, brutisso
This commit is contained in:
Thomas Schatzl 2015-08-20 15:17:43 +02:00
parent 041c76d48b
commit c91c77abd2
4 changed files with 27 additions and 18 deletions

View file

@ -248,8 +248,7 @@ HeapWord* ParScanThreadState::alloc_in_to_space_slow(size_t word_sz) {
}
}
if (buf_space != NULL) {
plab->set_word_size(buf_size);
plab->set_buf(buf_space);
plab->set_buf(buf_space, buf_size);
record_survivor_plab(buf_space, buf_size);
obj = plab->allocate_aligned(word_sz, SurvivorAlignmentInBytes);
// Note that we cannot compare buf_size < word_sz below