Fast and Compact: Reducing Size of AOT-Compiled Java Code without Sacrificing Performance

Research output: Chapter in Book/Report/Conference proceedingConference proceedingspeer-review

Abstract

GraalVM Native Image is a technology that compiles Java applications to native executables ahead of time (AOT). Due to highly aggressive optimizations, it is possible to reach a peak performance similar to that of a regular Java application executed on a Java Virtual Machine (JVM) and its Just-in-Time (JIT) compiler. The advantage of Native Image is much faster start-up when compared to the JVM and the JIT compiler. However, binary files resulting from Native Image tend to be quite large.
In this work, we present an approach to shrink the executables produced by Native Image while maintaining high peak performance: Instead of compiling everything to machine code, we exclude rarely or never executed methods and keep them as bytecode instead. When called, these methods can be run with a lightweight interpreter. If an interpreted method turns out to cause high overhead, its execution continues in native mode by simulating a JIT compiler. For the DaCapo benchmark suite, we are able to reduce the sizes of Native Image executables by up to 36.9% without significantly reducing peak performance or increasing start-up times.
Original languageEnglish
Title of host publicationMPLR '25: Proceedings of the 22nd ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes
EditorsTomoharu Ugawa
PublisherACM Digital Library
Pages12-22
Number of pages11
Edition1
ISBN (Electronic)9798400721496
ISBN (Print)979-8-4007-2149-6
DOIs
Publication statusPublished - 09 Oct 2025

Fields of science

  • 102 Computer Sciences
  • 102013 Human-computer interaction
  • 102009 Computer simulation
  • 102011 Formal languages
  • 102022 Software development
  • 102029 Practical computer science
  • 102024 Usability research

JKU Focus areas

  • Digital Transformation

Cite this