GraalVM.org


Why GraalVM native image?

In short, using GraalVM native image to compile Java applications into native executables has the potential to save CPU and Memory resources and this can translate into saving $Money in cloud hosting costs.

GraalVM native image achieves this by ahead-of-time compiling the Java application into a native executable. This results in faster startup times and lower memory consumption compared to traditional JVM-based applications.

This means we can see charts like this one below ...

GraalVM Deployment memory

Have a closer look at JVM vs GraalVM native image comparison.

How do Avaje Libraries help?

Avaje libraries avoid using Reflection, Dynamic proxies and Classpath scanning so they are well suited to be used in GraalVM native image applications.

Avaje libraries also provide specific support for GraalVM native image where needed. For example, avaje-config specifies resource loading for application.properties and application.yaml etc.

avaje-config

avaje-config is a configuration library that supports GraalVM native image. It supports loading configuration from properties and yaml files as well as environment variables, system properties and plugins (like AWS AppConfig).

avaje-http

avaje-http generates adapter code for @Controller and also HTTP clients. This code generation avoids the need for reflection and dynamic proxies, making it perfect for use with GraalVM native image.

avaje-jsonb

avaje-jsonb is a JSON binding library that uses code generation to create serializers and deserializers for Java objects. This approach avoids the need for reflection, making it ideal for GraalVM native image.

avaje-simple-logger

avaje-simple-logger is a simple structured JSON logger that is well suited to GraalVM native image applications. No reflection, lightweight, uses avaje-jsonb for optimised json serialisation and uses build time initialisation with GraalVM native image.

GraalVM Considerations

While GraalVM native image offers significant benefits, there are some considerations to keep in mind: