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

G1: ClassLoaderData verification keeps CLDs live that causes problems with VerifyDuringGC during Remark

XMLWordPrintable

    • gc
    • b02

      When running with -XX:+VerifyDuringGC G1 will do verification during the Remark and Cleanup pause. The "before" verification in Remark is causing class unloading to not work as expected because iterating over the CLDGs keeps all CLDs live. The call to ClassLoaderData::holder() in ClassLoaderDataGraphIterator::get_next() pushes it into the SATB queue, which is processed during Remark just a bit later.

      At least for the TestHumongousClassLoader.java this causes a test failure as the CLDs are not unloaded. This can be reproduce using -XX:VerifySubSet=classloader_data_graph (i.e. only do that specific verification) and if you instead run with -XX:VerifySubSet=heap the tests passes.

      One workaround could be to only verify the heap in the "before" verification for remark, exclude the CLDG verification in this verification or add a special iteration for this particular verification.

            tschatzl Thomas Schatzl
            sjohanss Stefan Johansson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: