In the slow path for PLAB allocation G1 needs to determine whether it should discard the current PLAB buffer to allocate an object or do direct allocation.
To keep the waste percentage goal of 10% (i.e. ParallelGCBufferWastePct) it always directly allocates objects that are larger than ParallelGCBufferWastePct percent of the current PLAB size. This results in direct allocations even in cases where the current PLAB is fully used up and should be retired.
It is better to directly check for whether the current PLAB can be retired i.e. the remaining PLAB space is < ParallelGCBufferWastePct of current PLAB size.
This moves the pathological behaviour to cases where allocations larger than the remaining PLAB space are allocated directly because the current PLAB cannot be retired (the remaining space is more than the threshold -ParallelGCBufferWastePct of current PLAB). This issue is addressed by JDK-8258088.