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

G1: Races in CHT growing cause memory waste in hash tables

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • hotspot
    • gc

      Element insertion in CHT with G1 is typically structured as follows:

      _table.insert(..., &grow_hint);
      [...]
      if (grow_hint) {
        _table.grow();
      }

      The problem is that in the time between insertion and growing additional threads can queue up to grow the table.

      E.g.
      Thread A: insert(... , grow_hint = true);
      Thread B: insert(... , grow_hint = true);
      Thread A: grow()
      Thread B: grow()

      There is some simplistic mechanism to cancel table growing in CHT's grow() call, but it does not seem sufficient.

      This is particularly apparent after use of a CHT with the same structure for code roots in JDK-8315503, but can also be seen with the card set to a lesser degree.

            Unassigned Unassigned
            tschatzl Thomas Schatzl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: