Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8314329

AgeTable: add is_clear() & allocation spec, and relax assert to allow use of 0-index slot

    XMLWordPrintable

Details

    • gc
    • b07

    Description

      I'd like to make a few changes to the AgeTable so as to be able to use it in GenerationalShenandoah.

      1. Traditional GCs would count object ages in the age table after incrementing their age, and compute the tenuring threshold following the GC, which they would use in the next minor collection to make tenuring decisions.

      Concurrent collectors such as Generational Shenandoah count object ages during the marking phase, using the demographic data to make a tenuring decision at the evacuation that follows the marking, and during which ages of surviving objects are incremented.

      The age table has a 0-indexed slot that can be used to record this information, but the assertion that object ages must be greater than 0 was too strong for use cases such as described above.

      We should relax the assert to allow collectors such as Generational Shenandoah to use the age table's 0th index.

      At the time of this writing, the tenuring threshold computation is bolted into the age table and is specific to stop-world collectors. We can either move the assertion check to that method (which is strictly later than when the original assert may have detected a violation), or move the check into the caller of the age table method where the assertion lives today.

      Ref: https://github.com/openjdk/shenandoah/pull/289/files#r1251339431

      2. The AgeTable should have an allocation spec, so as to allow it to be allocated independently rather than within a larger structure as is the case currently. In particular, this allows GenerationalShenandoah to track multiple age cohort histories (snapshots) using copies of the AgeTable.

      3. For verification of AgeTable preconditions with certain uses, such as described in (2) above, I'd like to add an `is_clear()` method that checks that the AgeTable is clean with no non-zero entries.

      Attachments

        Issue Links

          Activity

            People

              ysr Y. Ramakrishna
              ysr Y. Ramakrishna
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: