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

Move InstanceKlass DependencyContext cleaning to SystemDictionary::do_unloading()

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 12
    • 12
    • hotspot
    • None
    • b14

      During SystemDictionary::purge(), we used to call ik->dependencies().remove_all_dependents() on dead instance klasses that were about to be deleted. But that was buggy as nmethod unloading happening before purge() could have removed nmethods that died. So instead a new member function, ik->dependencies().wipe() was called during purge to solve that problem (https://bugs.openjdk.java.net/browse/JDK-8143408).

      This code breaks the idea of removing external references to dead metadata before purge. Therefore, I think it would be more ideal to move the cleaning of the DependencyContexts from SystemDictionary::do_unloading() instead. That way, when implementing concurrent class unloading, we can focus the locking in do_unloading and just delete things in SystemDictionary::purge(), after a rendezvous handshake. This also sounds like a better solution to the earlier bug.

            coleenp Coleen Phillimore
            eosterlund Erik Ă–sterlund
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: