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

Add diagnostic option to disable AOTCache classpath validation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • None
    • hotspot

      Background:

      Currently we forbid using AOTCache (i.e. CDS) with "exploded" directories in the classpath. For example:

      $ java -XX:AOTCache=app.aot -cp /my/classes/ App

      The AOTCache requires that the application classes must remain unchanged between cache assembly time and production run. As /my/classes/ may contain a large number of individual classfiles, it becomes time consuming to check for each of these classfiles. Such checks would defeat the start-up benefits of AOTCache.

      Requirement:

      There are some external regression test suites that have a large number of test cases, and all of them use classpaths that consist of "exploded" directories.

      To run such regression test suites with the AOTCache, normally it would require modifying the test harness to run the tests cases using JAR files. However, this is not scalable when the test suite contains hundreds of thousands of classes and tens of thousands of test cases, where each test case is executed with a different JVM command-line.

      Proposal:

      Add a new flag diagnostic -XX:+AOTDisableClassPathCheck. Its value is false by default. When the value is true, we disable all classpath checks in the AOTCache. As a result, it becomes possible to use AOTCache with exploded directories.

      When this option is selected, the JVM will print the following warning:

      "Diagnostic option AOTDisableClassPathCheck has been selected. AOTCache classpath validation is disabled. It's possible for classes in the AOTCache to be out of sync with classes in your file system.

      This option is strictly for testing purposes only and should not be used in production environment."

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

              Created:
              Updated:
              Resolved: