257. Introducing Application Class Data Sharing (AppCDS, or Java’s Startup Booster)
Launching a Java application is a multi-step process. Before executing the bytecode of a class, the JVM has to perform at least the following steps for a given class name:
- Look up the class on disk (JVM has to scan the disk and find the given class name).
- Load the class (JVM opens the file and loads its content).
- Check the bytecode (JVM verifies the integrity of the content).
- Pull the bytecode internally (JVM transfers the code into an internal data structure).
Obviously, these steps are not cost-free. Loading hundreds/thousands of classes will have a significant overhead on launching time and memory footprint. Typically, an application’s JAR remains unchanged for a long time, but JVM performs the previous steps and obtains the same result every time we launch the application.
Improving/accelerating the startup performance and even reducing the...