Micronaut is a reflection-free app-development framework that uses ahead-of-time (AoT) compilation to precompute everything in the application, paving the way for lightning-fast startup times and significantly reduced memory consumption. What if I told you that you can reduce the startup time by orders of magnitude? And what if you could reduce memory consumption even more?
GraalVM is a new universal virtual machine from Oracle that supports a polyglot runtime environment. GraalVM has the ability to compile Java applications down to native machine code, making it an ideal partner for Micronaut.
In this talk you will learn how you can take advantage of GraalVM's powerful capabilities to convert your Micronaut applications to run as binary native images.
7. Iván López @ilopmar
- Framework for microservices in the JVM
- Ultra-lightweight & reactive (Netty-based)
- Java, Groovy & Kotlin
- Ahead of Time compilation (AoT)
- No reflection, no runtime proxies
- Fast startup
- Low memory footprint
- Natively Cloud Native
- GraalVM support (improved a lot in Micronaut 2.x)
Micronaut
8. Iván López @ilopmar
$ mn create-app basic-app
--features=graalvm
Create an application with GraalVM support
9. Iván López @ilopmar
$ mn create-app basic-app
--features=graalvm
Create an application with GraalVM support
Micronaut 2.2 (Gradle & Maven)
21. Iván López @ilopmar
- Create a native image takes a lot of time
- And it needs a lot of RAM
- GraalVM changes so fast (and they break things)...
- ...and so we do ;-)
- We used Travis for testing Micronaut (now Github Actions), but...
- ...Travis has a limit for RAM
- We needed another way...
So… how do we test this?
22.
23. Iván López @ilopmar
- Scheduled jobs every hour (2.2.x / 2.3.x)
- Only run if new commits in Micronaut or GraalVM
- Compile GraalVM from source code (JDK8 & JDK 11)
- Also test GraalVM stable
- Create native images for test Micronaut applications
- Run native images and execute functional tests
- https://github.com/micronaut-graal-tests
- https://gitlab.com/micronaut-projects/micronaut-graal-tests
Tests using Gitlab CI
33. Iván López @ilopmar
GraalVM is a new and
interesting technology
Micronaut AoT is the
perfect match
Out-of-the-box support
in Micronaut
New improvements in
every release
Fast startup & low
memory footprint
Developers happy and
productive
Summary