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

Remove wrong assert and refactor code in G1CollectorPolicy::record_concurrent_mark_end

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P5
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
      gc
    • Resolved In Build:
      b42

      Backports

        Description

        G1CollectorPolicy::record_concurrent_mark() contains the following code:

        if (no_of_gc_threads > 0) {
          ...
        } else {
          assert(no_of_gc_threads > 0, ...);
        }

        The assert is wrong and will always fail. Apparently the else-part of that if is never executed.

        Fix this code by:
         - factor out the calculation of the WorkUnit variable into a method
         - remove the else-part and simply assert at the beginning of the method that no_of_gc_threads must be > 0
         - refactor the method, i.e. variable naming, according to coding guidelines

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mlarsson Marcus Larsson (Inactive)
                  Reporter:
                  tschatzl Thomas Schatzl
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: