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

Shenandoah: Recycle immediate garbage before concurrent class unloading

XMLWordPrintable

    • gc
    • b20

      Concurrent class unloading phase can take quite long time if there are many classes/nmethods to be unloaded.

      Shenandoah currently can not recycle immediate garbage after unloading is completed, because CLDs and nmethod metadata may still have dead oops pointing to those garbage regions.

      Not be able to recycle those regions early, puts pressure on memory, may drive GC into STW mode, which is highly undesirable.

      The solution is to pre-process CLDs and nmethods in weak roots phase, so that immediate garbage regions can be recycled after weak roots phase.

      Pre-processing adds a little extra work to concurrent weak roots phase:

      1) Applies ShenandoahIsCLDAliveClosure to all CLDs. The closure invokes cld->is_alive() that allows native barrier to null the cld->_holder (if it is dead) or evacuate it (if it is alive)

      2) Applies ShenandoahIsNMethodAliveClosure to all nmethods. The closure invokes nmethod->is_unloading() to cache unloading state in nmethod, so that, during concurrent class unloading phase, it won't touch unloading nmethod's metadata.




       

            zgu Zhengyu Gu
            zgu Zhengyu Gu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: