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

Cache classes in loaded state

XMLWordPrintable

      In JEP 483 (JDK-8315737), when the JVM starts, the boot/platform/app loaders are empty. AOT-linked classes are programmatically loaded into these loaders. One reason is to emulate the side effects of regular class loading. See discussion in

      https://github.com/iklam/jdk/commit/0367e6801229197e346c961982e19516cb2b7841#commitcomment-148011489

      However, this means the class of some archived heap object instances are not yet loaded when a GC happens, necessitating the work-around discussed in

      https://github.com/openjdk/jdk/pull/21143#discussion_r1802291536

      Also, the work spent in the loading operations will slow down start-up.

      Proposal:
      ============
      - All AOT-linked classes should be cached in (at least) the loaded state.
      - The correspond states in their class loaders (java.lang.ClassLoader in Java and ClassLoaderData in C++, etc) should also be preserved.

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: