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

Remove retry loop in collect of SerialHeap and ParallelScavengeHeap

XMLWordPrintable

    • gc

      After JDK-8192647, a GC-request, once inside a safepoint, will run-to-completion. Therefore, callers who requesting GCs don't need to retry in a loop any more.

      For example, the loop `ParallelScavengeHeap::collect` is unnecessary.

      ```
        while (true) {
          VM_ParallelGCCollect op(gc_count, full_gc_count, cause);
          VMThread::execute(&op);

          if (!GCCause::is_explicit_full_gc(cause)) {
            return;
          }

          {
            MutexLocker ml(Heap_lock);
            if (full_gc_count != total_full_collections()) {
              return;
            }
          }
        }
      ```

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: