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

G1 log for active workers is wrong

    Details

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

      Description

      The logging of number of workers used by the young GCs in G1 is wrong.

      The code looks like this:
      ---
          uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),
                                                                        workers()->active_workers(),
                                                                        Threads::number_of_non_daemon_threads());
          workers()->update_active_workers(active_workers);
          log_info(gc,task)("Using %u workers of %u for evacuation", active_workers, workers()->total_workers());
      ---

      This looks ok, but if anything goes wrong in when updating the number of active workers the value might not be what is expected. This is easily triggered by using -XX:+UseDynamicNumberOfGCThreads -XX:+UnlockDiagnosticVMOptions -XX:+InjectGCWorkerCreationFailure.

      The fix is also simple, just print workers()->active_workers().

        Attachments

          Activity

            People

            • Assignee:
              lkorinth Leo Korinth
              Reporter:
              sjohanss Stefan Johansson
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: