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

G1: Lazily initialize RSHashTables

XMLWordPrintable

    • gc
    • b19

      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.

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

              Created:
              Updated:
              Resolved: