News: 0001643948

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

GraalVM CE 25.1.3 Gets Native Image "Hello World" Program Down To Just 6.5MB

([Programming] 8 Hours Ago GraalVM Community 25.1.3)


GraalVM, the advanced JDK focused on ahead-of-time (AOT) Native Image compilation and since last year began [1]shifting focus to more non-Java languages like Python and JavaScript, is out with its newest community feature release. GraalVM Community Edition 25.1.3 is now available with some interesting changes in tow.

GraalVM 25.1.3 adds support for recording and replaying JIT compilations with the Graal compiler, a new disassembly tool is added, and there is optional constant blinding support for untrusted code. Plus new performance improvements, debugging enhancements, improved compatibility, Linux builds now producing Position Independent Executables (PIEs) by default, and other enhancements. There is also improved language support for GraalJS as the JavaScript offering, GraalPy for Python adding more features, and more.

GraalVM 25.1.3 also has Web Image as a new experimental back-end for GraalVM Native Image that compiles a Java application ahead-of-time to a WebAssembly module with a JavaScript wrapper.

Catching me most by surprise was a listed change for reducing Native Image sizes by further compacting them:

"Reduced Native Image size by compacting image heap metadata and storage, including module metadata, runtime dynamic-access metadata, and symbol table data, and intrinsifying simple constant String.format and String::formatted calls. This reduces the size of a HelloWorld application on Linux AMD64 to ~6.5 MB."

As in, catching me by surprise that getting a basic "Hello World" program down to ~6.5MB ... Perhaps too used to other languages, but a 6.5MB binary for a "Hello World" program?! I was curious how big the HelloWorld AMD64 Linux build was previously, so was digging through the activity. Much of Graal development is behind Oracle's closed doors but [2]this pull request brought up a public question over the impact on size. The additional Native Image compaction in this release " should be around 1-2% image size across the board. " And then further [3]elaborated :

"Overall, you will see larger improvements of 25.1 vs 25.0.x in image size, because we did several smaller optimizations in this area (some still pending) that add up. There is also a smaller positive effect on RSS due to the more compact representations. You will see a very large drop in helloworld image size due to the String format intrinsification."

But still, getting a HelloWorld app down to 6.5MB; is it just me or is that still rather bloated for all but the most elaborate "hello world" programs?

Downloads and more details on the GraalVM Community 25.1.3 release can be found via [4]GitHub .



[1] https://www.phoronix.com/news/GraalVM-Non-Java-Future

[2] https://github.com/oracle/graal/pull/13670

[3] https://github.com/oracle/graal/pull/13670#issuecomment-4670741703

[4] https://github.com/graalvm/graalvm-ce-builds/releases/tag/graal-25.1.3



I can't recall any difficulty in making the C language definition completely
open -- any discussion on the matter tended to mention languages whose
inventors tried to keep tight control, and consequent ill fate.
-- Dennis Ritchie (1941-2011), creator of the C programming language and of
UNIX