JDK-8321041 : GenShen: adaptive tenuring model should be improved
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: repo-shenandoah
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-11-29
  • Updated: 2024-01-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
repo-shenandoahUnresolved
Related Reports
Relates :  
Relates :  
Sub Tasks
JDK-8321302 :  
Description
From JDK-8316226:

[...] pursue improvements to the basic algorithm [...]

[...] work will entail at least characterizing the specific configuration of our generational system where earlier promotions cost space in the old generation that shrinks the headroom for the young generation causing an increase in minor GC frequency. This calls for a strategy that is also cognizant not only of the low mortality of a cohort that is identified for promotion, but the cost of that promotion because of stranding that memory until a major collection cycle occurs in the future. In heap constrained scenarios, the resulting increase in major and minor collections can easily overwhelm the time saved in marking fewer objects in a minor cycle. I would like to model this system at a high level and try and determine what the analytical model determines to be the population that should be tenured at each cycle, based on an assumed simple lifetime distribution of objects, which is likely to be a function of the instantaneous sizes and occupancies of the old and the young generation.

[...] filed for that modeling and experimentation exercise.


Comments
Suspending for now. Work on a subtask has been completed but showed no appreciable performance improvement. The work is being suspended for now and will be picked up after GenShen separation work progresses further. At that time, we will also file the remaining subtasks of this work.
17-01-2024

@kdnilsen has an implementation that produces a floor like in (2) above, but based instead on a user-specified minimum time that objects should be aged in the young generation before they are promoted: https://github.com/openjdk/shenandoah/commit/5ed215b9c3fe27705108d48394ca742cf9ebac8a
04-12-2023

The first tweak seemed to provide benefit w/Kelvin's extremem workload. More careful measurements and with a coupe of more workloads to be done.
01-12-2023

Some simple tweaks to try: 1. When reducing tenuring age in response to older cohorts with very low populations, compute the next tenuring threshold in the same manner as done today, but if this is lower than the tenuring threshold computed in the previous epoch, then xeno down to the lower threshold by stepping halfway to it from the previous value (rounding to integer values). This avoids suddenly decreasing tenuring age, and promoting more. It also gives any younger cohorts some grace time to die before promotion. This, however, is not foolproof and might still not deal well enough with the issue exhibited by Kelvin's extremem workload. 2. To deal with the situation of some low volume populations showing low initial mortality, we can potentially look at the volume of such objects and provide then with a further grace period. One possibility is to compute the cumulative population of cohorts younger than a given age, and if that population is below a suitably small value, we let them stay in the young generation. In a way this can be considered the equivalent of Ungar's adaptive tenuring threshold that provides a floor for the tenuring age that we compute. The cumulative volume may be made a suitable fraction of the new generation size, thus acting like survivor size in Ungar's algorithm. 3. Consider if using time intervals of epochs to compute a time-rate of mortality might serve better than our current strategy that counts the rate with respect to minor cycle ticks. Note that this won't make any difference for the current version of the algorithm because it serves as a common scaling factor for the rate for all cohorts, since we only consider the two most recent censuses. I'll evaluate the first two tweaks individually and together to see if they provide any benefits. For the third, we may consider older cohorts and see about revisiting a strategy that Kelvin had initially suggested that involves (as I recall) considering three consecutive epochs and comparing the rate of change of the rates (i.e. convexity or concavity), and which I shall incorporate into the write-up.
30-11-2023