Mastering Java 11
上QQ阅读APP看书,第一时间看更新

Class determination

The best practice for using CDS is to only archive the classes that are used. This will help keep the archive from bloating unnecessarily. We can use the following command line and flags to determine which classes are loaded:

java -Xshare:off -XX:+UseAppCDS -XX:DumpLoadedClassList=ch2.lst - cp cp2.jar Chapter2