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

G1 preserving marks during marking instead of actual forwarding requires all collectors to check for forwarded objects

XMLWordPrintable

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

      During review of JDK-8272147, this code has drawn attention:

      void PreservedMarks::adjust_preserved_mark(PreservedMark* elem) {
        oop obj = elem->get_oop();
        if (obj->is_forwarded()) {
          elem->set_oop(obj->forwardee());
        }
      }

      The check whether the object is actually forwarded seems superfluous, because why bother storing marks for objects there that are not forwarded.
      However this seems to be due to G1 full gc preserving marks during the marking phase when it is not completely clear that the object will actually be moved/forwarded (in G1FullGCMarker::mark_object()). All other collectors seem to only preserve marks for forwarded objects (needs to be verified), and this check a waste of time.

      Investigate whether it is possible to move the mark preservation to the point where the object is actually forwarded in G1 too.

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

              Created:
              Updated:
              Resolved: