G1 log for active workers is wrong

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 11
    • Affects Version/s: 11
    • Component/s: 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().

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

              Created:
              Updated:
              Resolved: