One virtual machine that can execute all languages (Java, JavaScript, R, Ruby, Python, C, C++, Kotlin, Scala, etc.) • You can run all those languages without any boundaries between them 2 What is GraalVM ?
Instant startup Scale to zero You only pay when your application is used Serverless for any kind of workload including regular web applications Good fit with platforms like Knative 3x to 5x memory reduction (RSS) Cheaper cloud instances Critical with systems split into multiple microservices
the main entry point • Configuration required for: • Reflection • Proxies • Resources • Classpath fixed at build time • No class lazy loading • Some code will run at build time 9 Key differences between JVM and Native
between the Spring and GraalVM engineering teams to support native ahead-of-time compilation for millions of Spring Boot applications. This is a game changer enabling low memory footprint and instant startup for these workloads.” Thomas Wuerthinger, GraalVM founder & project lead 19 Collaboration between the Spring and GraalVM teams
SNAPSHOT' Total time: 60 s 29 Build the native application • No need for a GraalVM native local install • Build happens in a container • And produces a container
60 s 33 Build the native application • Need for a GraalVM native local install • Build happens directly on your host (Linux, Mac and Windows are supported) • Produces a native executable • No cross compilation
patterns can be used • Similar config for reflection and proxies • See GraalVM documentation for more details 38 For example additional resources { "resources": [ { "pattern": "myresource.*" } ], "bundles": [ { "name": "your.pkg.Bundle" } ] }
these files, available with GraalVM java -Dorg.graalvm.nativeimage.imagecode=agent -agentlib:native-image-agent=config-output-dir=META-INF/native-image Demo • Agent has improved greatly during 2020, thanks to the GraalVM team • Run application with agent attached to produce .json files • Exercise all code paths (manually or via tests) - producing (merging) many of these collected configurations 39 Tracing agent to collect necessary information
• It includes a plugin for the GraalVM native image builder • Analyses the Spring Boot application at build time • Computes the most optimal native image configuration • Challenge is doing that with static analysis • Also perform some build time transformation for: • Optimized footprint • Compatibility 44 spring-graalvm-native
Boot 2.4.0 latest milestone (2.4.0-RC1) • Significant footprint improvements • Wider range of supported technology • New experimental functional mode • Spring Boot lightweight container integration • Maven • Gradle 45 We have just released 0.8.2