Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Industrial programming >> Java

Java 10: Enhancing Performance with Class-Data Sharing (CDS)

JEP 310 − Application Class-Data Sharing

When JVM starts it loads the classes in memory as a preliminary step. In case there are multiple jars having multiple classes, an evident lags appears for the first request. In serverless architecture, such a lag can delay the boot time which is a critical operation in such an architecture. Application class-data sharing concept helps in reducing the start up time of an application. Java has an existing CDS (Class-Data Sharing) feature. With Application class-data sharing, Java 10 allows to put application classes in a shared archive. This reduces the application startup and footprint by sharing a common class meta data across multiple java processes.

Process

Application Class data sharing is a 3 step process.

$java -Xshare:off -XX:+UseAppCDS -XX:DumpLoadedClassList=welcome.lst -cp welcome.jar Greeting
$java -Xshare:dump -XX:+UseAppCDS -XX:SharedClassListFile=welcome.lst -XX:SharedArchiveFile=welcome.jsa -cp welcome.jar
$java -Xshare:on -XX:+UseAppCDS -XX:SharedArchiveFile=welcome.jsa -cp welcome.jar Greeting

Java

  1. Master Java Operators: Types, Syntax, & Practical Examples
  2. Java Comments: Types, Usage, and Best Practices
  3. Mastering Java if…else: Control Flow Explained
  4. Mastering Java's super Keyword: Advanced Usage & Practical Examples
  5. Mastering Java Interfaces: Concepts, Implementation, and Best Practices
  6. Mastering Java Try‑with‑Resources: Automatic Resource Management Explained
  7. Java Annotations Explained: Types, Placement, and Practical Examples
  8. Java Swing Tutorial: Building Robust GUI Applications
  9. Java 10: Enhancing Performance with Class-Data Sharing (CDS)
  10. Optimizing Java 9 Apps on PLCnext Control Using Jlink