attempted to eliminate unnecessary gc-locker collections that sometimes immediately followed another young collection. Although this problem was only reported against G1, and the fix is G1-specific, it was later (
) found to be a problem for several other collectors too.
also showed that the
change was insufficient, and unnecessary gc-locker collections could still occur, due to a race with the GCLocker's active state handling.
made threads failing allocation stall when the GCLocker indicates a GC is needed, forcing them to wait until the gc-locker collection has been done. It would be better to only stall when the GCLocker is active and a GC is needed, as is done by other collectors. This allows a thread failing allocation to proceed to the GC without waiting for the no-longer-active GCLocker's collection attempt, with the quickest doing the honors.