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

Shenandoah: pre-Full GC root updates may miss some roots

    XMLWordPrintable

    Details

    • Subcomponent:
      gc
    • Resolved In Build:
      b03

      Backports

        Description

        Look at Full GC marking code:

        void ShenandoahMarkCompact::phase1_mark_heap() {
          ...
          cm->update_roots(ShenandoahPhaseTimings::full_gc_update_roots);
          cm->mark_roots(ShenandoahPhaseTimings::full_gc_scan_roots);
        }

        It enters update_roots, which ends up calling this:

        void ShenandoahRootUpdater::roots_do(uint worker_id, IsAlive* is_alive, KeepAlive* keep_alive) {
          ...
          _serial_weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
          ...
          _weak_roots.weak_oops_do(is_alive, keep_alive, worker_id);
          ...
          _dedup_roots.oops_do(is_alive, keep_alive, worker_id);
        }

        But the problem is, at this point we already have clear bitmap, so "is_alive" always replies "false", and so the particular roots might not be updated at all. This is an obscure corner case that matters when heap has forwarded objects in roots that need updates, and we run into Full GC.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                zgu Zhengyu Gu
                Reporter:
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: