Enhancing CDS

Often, developers end up not using a feature that could enhance the performance of their application—out of ignorance—by just missing a step. Or should we call it a usability issue?

At present, even though the JDK includes a default class list, it can be used with the following command:

java -Xshare:dump

Even though this behavior is documented, developers miss reading the document, and hence, can't use this feature.

JDK 12 modifies the build process. It runs the java -Xshare:dump command after linking it to the class list. To ensure that the CDS archive file is part of the JDK image, the shared archive file is placed in the lib/server directory.

The shared archive file is used automatically during application startup, since -Xshare:auto is the default option with the server VM in JDK 11. So, unless it is specifically turned off using the -Xshare:off option, developers and applications will continue using it without executing any additional commands or set up.

CDS includes a predefined list of classes and interfaces from the core Java API. For the inclusion of specific API or application classes, or for specific GC behavior, developers can create and use a custom archive file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.35.255