In an effort to improve Java performance in cloud environments, an OpenJDK proposal is afoot to reduce the size of the JDK (Java Development Kit) by about 25%. The plan calls for enabling the jlink
tool to build custom runtime images without using the JDK’s JMOD files.
The JDK Enhancement Proposal (JEP), titled Linking Run-Time Images without JMODs, is motivated by the desire to reduce the installed size of the JDK on the file system in cloud environments, where container images that include an installed JDK are frequently copied over the network from container registries. Reducing the size of the JDK would improve the efficiency of these operations, the proposal states. The JEP notes that enabling the jlink
tool to create custom runtime images without using the JDK’s JMOD files must be enabled when the JDK is built and will not be enabled by default. Some JDK vendors may choose not to enable it.
The proposal explains that a complete, installed JDK has two main components: a run-time image, which serves as the executable Java runtime system, and a set of packaged modules, in the JMOD format, for each module in the runtime image. JMOD files are used by the jlink
tool when creating custom runtime images. The runtime image in a complete JDK itself was created from these JMOD files via jlink
. Hence, every class file, native library, configuration file, and other resource in the runtime image also is present in one of the JMOD files, which is arguably a “massive waste of space,” according to the proposal.