- Java 11 and 12:New Features
- Mala Gupta
- 306字
- 2021-07-02 12:27:03
What is CDS?
CDS has been a commercial feature with Oracle JVM since Java 8. CDS helps in two ways—it helps to reduce the startup time of a Java application and reduces its memory footprint with multiple Java Virtual Machines (JVMs).
When you start up your JVM, it performs multiple steps to prepare the environment for execution. This includes bytecode loading, verification, linking, and initializing of core classes and interfaces. The classes and interfaces are combined into the runtime state of JVM so that they can be executed. It also includes method areas and constant pools.
These sets of core classes and interfaces don't change unless you update your JVM. So, every time you start your JVM, it performs the same steps to get the environment up for execution. Imagine you could dump the result to a file, which could be read by your JVM at startup. The subsequent startups could get the environment up and running without performing the intermediate steps of loading, verification, linking, and initialization. Welcome to CDS.
When you install JRE, CDS creates a shared archive file from a set of predefined set of classes from the system jar file. Classes are verified by the class loaders before they can be used—and this process applies to all the classes. To speed up this process, the installation process loads these classes into an internal representation and then dumps that representation to classes.jsa—a shared archive file. When JVM starts or restarts, classes.jsa is memory-mapped to save loading those classes.
When JVM's metadata is shared among multiple JVM processes, it results in a smaller memory footprint. Loading classes from a populated cache is faster than loading them from the disk; they are also partially verified. This feature is also beneficial for Java applications that start new JVM instances.
- Vue.js 3.x快速入門
- ClickHouse性能之巔:從架構設計解讀性能之謎
- Java虛擬機字節碼:從入門到實戰
- Learning Python Design Patterns(Second Edition)
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發 (未來書庫)
- Java程序員面試筆試寶典(第2版)
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Python入門很輕松(微課超值版)
- 代碼閱讀
- QGIS 2 Cookbook
- Greenplum構建實時數據倉庫實踐
- Modular Programming with JavaScript
- C/C++代碼調試的藝術(第2版)
- Effective C++:改善程序與設計的55個具體做法(第三版)中文版(雙色)
- VMware vSphere Design Essentials