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

G1 log for active workers is wrong

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 11
    • 11
    • hotspot
    • gc
    • b10

      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().

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

              Created:
              Updated:
              Resolved: