When a JRE is installed via an Oracle JRE installer, the installer creates a shared archive that enables class data sharing (CDS), reducing startup time and memory footprint of JRE processes.
Questions
If our installer instead installs a JRE by copying a JRE directory, do we lose class data sharing?
If so, can that be solved by regenerating the shared archive (using java -Xshare:dump
) from our own installer?
Is there a mechanism in Java code to detect whether class data sharing is active or not?
Our install includes a shared archive (e.g., jre/bin/client/classes.jsa) that was presumably created on the original machine onto which we installed Java with the Oracle installer. Is this useful, harmless, or harmful?
Details
We're using Java 7. At least on some machines, we're using the HotSpot client VM.
Related questions
"Is the Java code saved in a Class Data Sharing archive (classes.jsa) compiled natively or is it bytecode?" - Accepted answer says native, but appears to be somewhat of a guess.