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

G1: Unbalanced bulk nmethod unregistering

    XMLWordPrintable

Details

    • gc

    Description

      JDK-8315503 changed the code root set to use a CHT, among other things this improved balancing during scanning it.
      Another improvement has been bulk nmethod unregistering during class unloading: instead of unregistering nmethod by nmethod, g1 now bulk removes dead nmethods from the code root sets in parallel on a per remembered set (region) basis.

      However it happens that if code root sets are unbalanced, so lots of efficiency can be lost.

      The following log snippet (additional augmentations) shows how long each thread of the task in G1CollectedHeap::remove_dead_entries_from_code_root_sets() takes for doing this bulk unregistering:

      [725,544s][gc ] GC(140) clean_code_root_sets task worker 3 time 0,42
      [725,544s][gc ] GC(140) clean_code_root_sets task worker 1 time 0,45
      [725,544s][gc ] GC(140) clean_code_root_sets task worker 5 time 0,49
      [725,544s][gc ] GC(140) clean_code_root_sets task worker 13 time 0,52
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 12 time 0,56
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 9 time 0,67
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 15 time 0,70
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 11 time 0,96
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 2 time 0,97
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 7 time 1,24
      [725,545s][gc ] GC(140) clean_code_root_sets task worker 8 time 1,35
      [725,546s][gc ] GC(140) clean_code_root_sets task worker 4 time 1,71
      [725,546s][gc ] GC(140) clean_code_root_sets task worker 0 time 1,93
      [725,546s][gc ] GC(140) clean_code_root_sets task worker 6 time 2,35
      [725,555s][gc ] GC(140) clean_code_root_sets task worker 14 time 11,41
      [725,555s][gc ] GC(140) clean_code_root_sets task worker 10 time 11,42
      [725,555s][gc,phases ] GC(140) Clean CodeRoots 11,515ms

      (times in ms)

      on the reproducer from JDK-8315503. I.e. two threads taking 11.4ms, the others <2.35ms and most of them <1ms.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: