I'm trying to know whether creating a Class Data Sharing archive (by running java -Xshare:dump
) compiles byte code into native code.
There is not a lot of documentation about the internals of Class Data Sharing. The page I linked says that java -Xshare:dump
loads a set of classes from the system jar file into a private internal representation, and dumps that representation to a file.
But says nothing about whether this code is compiled or not.
(Possibly related: Speed up application start by adding own application classes to classes.jsa)
The Class data sharing (CDS) feature helps reduce the startup time and memory footprint between multiple Java Virtual Machines (JVM). Starting from JDK 12, a default CDS archive is pre-packaged with the Oracle JDK binary.
The class sharing feature offers the transparent and dynamic sharing of data between multiple Java™ Virtual Machines (JVMs).
Application Class-Data Sharing This feature allows application classes to be placed in a shared drive. The common class metadata is shared across different Java processes. AppCDS allows the built-in system class loader, built-in platform class loader, and custom class loaders to load the archived classes.
In both cases it's native code in the cache (see the discussion in the link you provided about regenerating the cache on machines of different architecture). The IBM JVM takes it further with more options and a nicer layout for clusters, but the Oracle one works too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With