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

Unreachable classes are not deleted after the end of Conc Mark Cycle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • gc
    • 9

      According JDK-8049421 G1 is able to unload unreachable classes at the remark pause.
      I attached a test which shows that unreachable classes are unload only after full gc, but not after ConcMarkCycle.

      The test does the following:
      1, compiles SimpleClassLoader which loads classes with specified name <prefix>, other classes are loaded by parent Class Loader
      2. compiles ChildClassLoader which extends SimpleClassLoader
      3. compiles <prefix>BaseClass and (<prefix>TestClass extends <prefix>BaseClass)
      4. loads <prefix>TestClass using ChildClassLoader
      5. forgets all links to classes and both classloaders
      6. in case of full gc unreachable classes and ChildClassLoader are unloaded.
      7. in case of ConcMarkCycle unreachable classes and ChildClassLoader are not unloaded.

            kzhaldyb Kirill Zhaldybin (Inactive)
            kzhaldyb Kirill Zhaldybin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: