RFR: Shrink tlab to capacity

Kelvin Nilsen kdnilsen at openjdk.org
Fri Dec 9 23:41:39 UTC 2022


When a TLAB request exceeds the currently available memory within young-gen, the existing behavior is to reject the TLAB request outright. This is recognized as a failed allocation request, which triggers degenerated GC.

This change introduces code to reduce the likelihood that too-large TLAB requests will be issued, and when they are issued, it makes an effort to shrink the TLAB request in order to reduce the need for degenerated GC.

The impact is difficult to measure because this situation is fairly rare.  On one Extremem workload, the TLAB-shrinking code is exercised only once during a 16-minute run involving 500 concurrent GCs, a 45 GiB heap, and a 28 GiB young-gen size.  The change reduces the degenerated GCs from 6 to 5.

One reason that the remaining 5 degenerated GCs are not addressed by this change is that further work is required to handle a situation in which a requested TLAB is smaller than the available young-gen memory, but available memory is set aside in the evacuation reserve so cannot be provided to a mutator.  Future work will address this condition.

-------------

Commit messages:
 - Fix whitespace
 - Merge branch 'master' into shrink-tlab-to-capacity
 - Experiments to confirm proper operation
 - Merge remote-tracking branch 'GitFarmBranch/shrink-tlab-to-capacity' into shrink-tlab-to-capacity
 - Remove some debug instrumentation
 - Fix log message to avoid assertion failure
 - Change <= to < in test for shrinking tlab request size
 - Fix spelling error in assertion
 - Restructure control to avoid goto statement
 - Resize tlab request if larger than adjusted available

Changes: https://git.openjdk.org/shenandoah/pull/180/files
 Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=180&range=00
  Stats: 184 lines in 2 files changed: 71 ins; 39 del; 74 mod
  Patch: https://git.openjdk.org/shenandoah/pull/180.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah pull/180/head:pull/180

PR: https://git.openjdk.org/shenandoah/pull/180


More information about the shenandoah-dev mailing list