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

G1: Calculation to fit in optional region in remaining pause time wrong

XMLWordPrintable

    • gc
    • b23

      In G1Policy::calculate_optional_collection_set_regions there is this code:

        double prediction_ms = 0;
        [...]
        while (num_optional_regions < max_optional_regions) {
          [...]
          prediction_ms += predict_region_total_time_ms(r, false); // note the +=

          if (prediction_ms > time_remaining_ms) {
            [...]
            break;
          }
          // This region will be included in the next optional evacuation.

          time_remaining_ms -= prediction_ms; // and then we subtract that sum of sum...
          [...]
        }

      As you can see, the code subtracts the prediction from the remaining time that in itself is accumulated over all times the recently added optional regions take.

      This causes too few optional regions to be taken in optional evacuation.

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

              Created:
              Updated:
              Resolved: