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

ClassLoaderDataGraph::purge triggers safepoints too often

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 24
    • 17, 21, 23, 24
    • hotspot

      In my application using Corretto 17.0.11.9, I observe that every Shenandoah cycle includes a safepoint for CleanClassLoaderDataMetaspaces. The CleanClassLoaderDataMetaspaces safepoints are often longer than all of the GC safepoints for one cycle combined, which is increasing our latency.

      Is there any way to avoid this safepoint if it's not needed? For example, could we skip the clean up -- either locally at safepoint, or at safepoint caused by ServiceThread -- if no classes have been unloaded? I.e. can we predicate this block: https://github.com/openjdk/jdk17u/blob/c1c901179e8eac74d31c10fa7591787be7ce2668/src/hotspot/share/classfile/classLoaderDataGraph.cpp#L579-L592 with `classes_unloaded`?

      I've attached a screenshot of Mission Control showing the long CleanClassLoaderDataMetaspaces safepoints in the middle of each Shenandoah cycle.

            coleenp Coleen Phillimore
            ogillespie Oli Gillespie
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: