-
Task
-
Resolution: Unresolved
-
P4
-
None
-
None
As currently implemented, try_allocate_in() retires a region if it cannot satisfy a particular allocation request from that region and the remaining free memory within the region is less than ShenandoahEvacWaste percent. With default value of ShenandoahEvacWaste, this may leave 17% of the region unused.
With large region sizes, this can introduce considerable waste, contributing to degeneration and/or allocation stalls.
This heuristic was apparently introduced to align with the intent of ShenandoahEvacWaste, which endeavors to account for alignment waste. If we need to relocate N bytes of data, we reserve ShenandoahEvacWaste (default 1.2) * N to hold the relocated objects. This interpretation is misguided because it fails to account for the waste within each TLAB. The fact that there is less that the targeted amount of waste within the region does not mean that the used memory within the region is 100% utilized. There is additional waste there because each retired TLAB has some amount of waste within it and because some threads may have allocated TLABS that are much larger than they will consume before they are required to retire them for the next GC phase change.
We recommend removing this retirement condition. Instead, we should only retire if the remaining free memory within the region is smaller than the minimum tlab size.
With large region sizes, this can introduce considerable waste, contributing to degeneration and/or allocation stalls.
This heuristic was apparently introduced to align with the intent of ShenandoahEvacWaste, which endeavors to account for alignment waste. If we need to relocate N bytes of data, we reserve ShenandoahEvacWaste (default 1.2) * N to hold the relocated objects. This interpretation is misguided because it fails to account for the waste within each TLAB. The fact that there is less that the targeted amount of waste within the region does not mean that the used memory within the region is 100% utilized. There is additional waste there because each retired TLAB has some amount of waste within it and because some threads may have allocated TLABS that are much larger than they will consume before they are required to retire them for the next GC phase change.
We recommend removing this retirement condition. Instead, we should only retire if the remaining free memory within the region is smaller than the minimum tlab size.