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

G1: Do not take the global nmethod lock during Code cache cleanup

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • tbd
    • None
    • hotspot
    • gc

      During class unloading, code cache cleanup takes a significant amount of time due to the code taking the global NMethodEntryBarrier_lock lock (when disarming the nmethod, in BarrierSetNMethod::guard_with()).

      However the existing parallel nmethod cleaning in G1ParallelCleaningTask already splits the work on a per-nmethod basis, so taking this lock isn't necessary (and we are at a safepoint anyway).

      Change the code to not take the lock in this situation; as an alternative, per-nmethod locks could be implemented (still it would be a waste to take these anyway) during that time.

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

              Created:
              Updated:
              Resolved: