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

Phase timings not updated correctly after JDK-6672778

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b18

      Backports

        Description

        The improvements in JDK-6672778 complicated the timing code in G1. Since trimming of the queues, which should be accounted as object copy can happen during other phases, can happen during other phases this needs to be taken into account in the timings.

        A few helper classes was added to make this code easier to follow, but there is a bug in the helper class G1EvacPhaseTimesTracker. In this class the destructor assumes that a member has already been destructed and updated another member:
        G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
          if (_phase_times != NULL) {
            // Exclude trim time by increasing the start time.
            _start_time += _trim_time;
            _phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
          }
        }

        The _trim_time member above is not updated until another member _trim_tracker has been destructed which happens after the destructor above is run.

        The G1EvacPhaseTimesTracker is used for three phases ExtRootScan, ScanHCC and UpdateRS.

        I've seen problems with refinement because of this. G1 report spending a lot of time in Update RS and then we activate more refinement threads to reduce this. So we get shorter pause times but spend more time concurrently which is bad for throughput.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  sjohanss Stefan Johansson
                  Reporter:
                  sjohanss Stefan Johansson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: