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

incorrect sum/average time in WorkerDataArray

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc

      Description

      with gc+phases*=trace, we have the following log entries

      [4.469s][debug][gc,phases ] GC(0) Object Copy (ms): Min: 1145.4, Avg: 860.0, Max: 1147.4, Diff: 2.0, Sum: 3440.1
      [4.469s][trace][gc,phases,task] GC(0) 1146.5 1147.3 1147.4 1145.4
      [4.469s][debug][gc,phases ] GC(0) Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.1
      [4.469s][trace][gc,phases,task] GC(0) 0.0 0.0 0.0 0.1
      [4.469s][debug][gc,phases ] GC(0) Termination Attempts: Min: 8, Avg: 6.8, Max: 10, Diff: 2, Sum: 27
      [4.469s][trace][gc,phases,task] GC(0) 10 9 8 10

      The Average and Sum is recorded incorrectly. For example, Termination Attemps sum should be 37, not 27. Average is 9.2, not 6.8.

      The reason is
      workerDataArray.inline.hpp
      template <typename T>
      T WorkerDataArray<T>::sum() const {
        T s = 0;
        for (uint i = 0; i < _length; ++i) {
          if (get(i) != uninitialized()) {
            s += get(i);
          }
        }
        return s;
      }
      ++i should be i++
      Not sure if it has impact on prediction.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                yuzhang Jenny Zhang (Inactive)
                Reporter:
                yuzhang Jenny Zhang (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: