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

G1: Lazily initialize RSHashTables

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b19

      Description

      At bootstrap we create a SparsePRT for each region, which uses C-heap allocated storage in RSHashTable. These can be lazily allocated with no negative effect on pause times:

      Proposed implementation is simple:

      - Allocate a static, empty RSHashTable and assign a reference to that to every new SparsePRT.
      - When adding a card - we piggyback on existing expand logic to allocate a new RSHashTable at the expected InitialCapacity

      This allows logic that checks for cards etc to remain oblivious to the lazy initialization (potentially even a bit faster, since scanning the empty RSHashTables will take fewer instructions, and more likely hit cache).

      Experiment shows a reduction in the per-region overhead of ~10% with an improvement to #insns retired by a Hello World by ~0.4% on my system. Effect scales up or down based on max # regions.

        Attachments

          Activity

            People

            • Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: