Skip to content

Deployment is bigger than with other JREs #511

@mlaggner

Description

@mlaggner

I recently switched from the Azul JRE to the JBR JRE and recognized, that my deployment is much bigger than with the Azul JRE.

Hunting down the issue has shown me, that the /lib/modules from your JRE heavily differs from Azul (and also Adoptium, which I analyzed too). It looks like that on JBR the modules container has been built with the parameter --compress=2 (probably here if I found the right script: https://github.com/JetBrains/JetBrainsRuntime/blob/jbr-release-21.0.6b872.80/jb/project/tools/windows/scripts/mkimages_x64.sh#L64) which results in a "slightly" compressed modules container (57MB vs 100MB from Azul/Adoptium).

This leads to another "problem" if you package your final app for deployment (especially with LZMA - I've tested XZ and ZSTD) - the modules can't be compressed any further (57MB from the JRE -> 53MB compressed) while other JVMs (Azul/Adoptium) can be compressed by far better (100MB from the JRE -> 24MB compressed).

Having said this, I also compared the compression of the whole JRE between JBR/Azul/Adoptium (all 21.0.6) with XZ and the best compression algorithm. I know that the JREs differ slightly, but the finally compressed archive should not differ that much. But JBR is by far bigger than others:

  • JBR - 69MB
  • Azul - 29MB
  • Adoptium - 29MB

To get those results, I made many tests comparing different parts of the JVM at all and it looks like LZMA cannot compress the modules any further.

Having said this, I am unsure what benefits the compression of /lib/modules offers beside saving ~43MB of storage (runtime). The drawback here is that the JVM probably needs to extract the container at runtime (performance) and the deployment size is just bigger for many use cases (especially if you plan to re-package the final deployment with LZMA - waste of bandwidth).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions