SlideShare a Scribd company logo
Alina Yurenko
Using GraalVM
in Production
Oracle
About me
• Alina Yurenko / @alina_yurenko
• Developer Advocate for GraalVM
at Oracle
• Love open source and
communities 🤝
• Love both programming 👩💻 &
natural languages 🗣
@alina_yurenko
GRAALVM 🚀
An advanced JDK with AOT
Native Image compilation
native-image MyMainClass
./mymainclass
JIT AOT
java MyMainClass
2017 2018 2019 2020 2021 2022 2023
2005 2011
... ...
Graal History
Sun Labs’
Maxine Java
JVM initial
release
December
Native Image
open sourced
April
Twitter uses
Graal JIT for
core
microservices
October
Micronaut
1.0 with
Native
Image
support
April
GraalVM 1.0
released
April
Thomas
Wuethinger
joins Oracle and
starts Graal
compiler project
September
Spring Native
project
launched
November
Quarkus 1.0
with Native
Image
support
May
GraalVM
Enterprise
Edition 19
Product
Released
September
MicroDoc
announces
GraalVM for
embedded
July
Alibaba start
using Native
Image in
production
July
Facebook
deploys
GraalVM in
production
May
AWS SDK
support for
Native
Image
November
Spring Boot 3
with Native
Image support
December
OpenJDK
Galahad
project
proposed
July
Google Cloud
Platform SDK
support for
Native Image
June
GraalVM Free
Terms and
Conditions
license
September
GraalOS &
Layered
Native
Image
announced
March
Azure SDK
support for
Native
Image
2024
October
Microsoft
joins
GraalVM
Advsory
Board
September
GraalPy &
GraalWasm
production
ready
🎉
🎉
🎉
🎉
GraalVM Native Image AOT Compilation
Ahead-of-Time
Compilation
Application
Libraries
JDK
Substrate VM
Points-to Analysis
Run Initializations
Heap Snapshotting
Input:
All classes from application,
libraries, and VM
Code in
Text Section
Image Heap in
Data Section
Image Heap
Writing
Output:
Native executable
@alina_yurenko
DEMO 👩💻
GraalVM Native Image—Fast Start Up and Much More
Improved
Security
Fast Start
& Scale
Lower Resource
Usage
Compact
Packaging
Predictable
Performance
Wide
Ecosystem
Azure
AWS
GCP
OCI
@alina_yurenko
FRAMEWORKS
AND
LIBRARIES 📚
NATIVE IMAGE
BUILD-TIME DISCOVERY
AND CONFIGURATION
SPRING BOOT
RUN-TIME DISCOVERY
AND CONFIGURATION
SPRING BOOT NATIVE IMAGE
SPRING AOT
SPRING AOT
SPRING AOT
JAVA SOURCE FILES
BYTECODE
HINT FILES
200+ libraries and frameworks integrating and testing with Native Image
Ready for GraalVM Native Image
graalvm.org/native-image/libraries-and-frameworks
@alina_yurenko
Libraries, dynamic Java features, and Native Image
• Libraries might be Native-Image friendly out of the box
• twitter.com/YunaMorgenstern/status/1729039787351536084
• Libraries might include config for Native Image:
• github.com/h2database/h2database/blob/master/h2/src/main/META-INF/native-image/
• Libraries might contain config in the Reachability Metadata Repository
• github.com/oracle/graalvm-reachability-metadata/tree/master/metadata/io.netty
• You can use framework support to produce custom “hints” for Native Image
runtimeHints.resources().registerPattern(“config/app.properties”);
• You can use the Tracing Agent to produce the necessary config automatically
• graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/
• You can provide/extend config for reflection, JNI, resources, serialization, and
predefined classes manually in JSON:
• graalvm.org/latest/reference-manual/native-image/metadata/#specifying-metadata-with-json
Happy path;
most of the cases
Custom code/
libraries
@alina_yurenko
PERFORMANCE
DEMO 👩💻
AOT at the speed of JIT 🚀
• Profile-guided optimizations
Collect and use profiles to
optimize for the specific runtime
behaviour of your application
• ML-enabled PGO
Use a ML model to
automatically predict the
profile of the application
• G1 GC
Optimize GC for peak throughput
and improved latency
• `-march=native`
Optimize for the specific
hardware features of the
machine you’ll be running on
@alina_yurenko
USING GRAALVM IN PRODUCTION - JAVAONE.pdf
BEST PRACTICES
Container Size (MB)
0
125
250
375
500
Debian 12-slim
+ JDK 21
Distroless Java 21 Distroless Java Base
+ jlink
Distroless Java Base
+ Native Image
Distroless Base
+ Native Image
Distroless Static
+ Native Image
18.1
36.3
48.9
127
199
405
95.5% container image size reduction
JDK’s Simple Web Server
GraalVM Native Image
JVM
Compact
Packaging
@alina_yurenko
Cross-Platform Builds on GitHub Actions
Windows
Executable
macOS
Executable
Linux
Executable
.class
.jar
.class
.jar
GraalVM GitHub
Action 🏗
@alina_yurenko
Recommendations
• Migrate 🚀
• Add Native Build Tools
• Alternatively, use recent versions of frameworks
• Evaluate libraries: graalvm.org/native-image/libraries-and-frameworks
• Build and deploy 👷
• Build and test on GraalVM as the JVM, build with Native Image closer to the deployment
• Quick build mode with `-Ob`
• Use CI/CD systems (e.g. GitHub actions) for deployment and cross-platform builds
• Monitor
• jvmstat, JFR, JMX, Micrometer, cloud vendor solutions
• Run faster 🚀
• PGO
• ML-enabled PGO
• G1 GC
• `-march=native`
@alina_yurenko
MONITORING 👩💻
• Reduced attack surface area
due to dead code removal—
unused classes, methods, and
fields not included in
executable
Improved
Security • Not vulnerable to JIT
compiler attacks
all code is AOT compiled
• SBOM supporting industry
standards
Embedded in executables
CycloneDX format
• Not vulnerable to
deserialization attacks via
class loading—executable
includes only required and
specified classes
Reduced Attack Surface 🛡
@alina_yurenko
WHAT’S NEXT?
GraalVM for JDK 24 🚀
• Java 24 features 😍
• The fastest GraalVM yet :)
• New ML profile inference for even higher
performance out of the box 🤖
• Smaller executables 📦
• Vector API support in Native Image 🚀
• New SBOM features 🛡
• Developer experience improvements 👩💻
Learn more: medium.com/graalvm
@alina_yurenko
sdk install java
24-graal
Get started with GraalVM 🚀
graalvm.org
github.com/graalvm/
graalvm-demos
docker pull container-
registry.oracle.com/
graalvm/jdk:24
@alina_yurenko
Questions & let’s connect! Demos 👩💻
@alina_yurenko
USING GRAALVM IN PRODUCTION - JAVAONE.pdf
USING GRAALVM IN PRODUCTION - JAVAONE.pdf

More Related Content

PPTX
All you need to know about Spring Boot and GraalVM
PPTX
Bring the Action: Using GraalVM in Production
PPTX
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
PDF
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
PPTX
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
PPTX
Going AOT: Everything you need to know about GraalVM for Java applications
PPTX
Ways to Level Up Your Java Application with GraalVM.pptx
PDF
Everything you need to know about GraalVM Native Image
All you need to know about Spring Boot and GraalVM
Bring the Action: Using GraalVM in Production
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM FOR JAVA - JAVAZONE
Going AOT: Everything you need to know about GraalVM for Java applications
Ways to Level Up Your Java Application with GraalVM.pptx
Everything you need to know about GraalVM Native Image

Similar to USING GRAALVM IN PRODUCTION - JAVAONE.pdf (20)

PDF
Peru JUG Micronaut & GraalVM
PDF
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
PDF
[IO Extended KL] On-Device AI: Is It Time to Go All-In, or Do We Still Need t...
PDF
GraalVM - MadridJUG 2019-10-22
PDF
GraalVM - OpenSlava 2019-10-18
PDF
PDF
GraalVM Overview Compact version
PDF
What's new in Gradle 4.0
KEY
Google App Engine Java, Groovy and Gaelyk
PDF
Neptue Graph Database - 0 to Production
PDF
AOT and Native with Spring Boot 3.0
PDF
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
PPTX
GraphQL-ify your APIs
PDF
Quarkus Extensions Turbocharge for Java Microservices.pdf
PPTX
Faster java ee builds with gradle [con4921]
PPTX
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
PDF
GraalVM and Oracle's Documentation Trends.pdf
PPT
Nakal think test_2015
PDF
Building GPE: What We Learned
PDF
Keeping your build tool updated in a multi repository world
Peru JUG Micronaut & GraalVM
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
[IO Extended KL] On-Device AI: Is It Time to Go All-In, or Do We Still Need t...
GraalVM - MadridJUG 2019-10-22
GraalVM - OpenSlava 2019-10-18
GraalVM Overview Compact version
What's new in Gradle 4.0
Google App Engine Java, Groovy and Gaelyk
Neptue Graph Database - 0 to Production
AOT and Native with Spring Boot 3.0
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
GraphQL-ify your APIs
Quarkus Extensions Turbocharge for Java Microservices.pdf
Faster java ee builds with gradle [con4921]
Exploring Next Generation Buildpacks - Anand Rao & Scott Deeg
GraalVM and Oracle's Documentation Trends.pdf
Nakal think test_2015
Building GPE: What We Learned
Keeping your build tool updated in a multi repository world
Ad

Recently uploaded (20)

PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Essential Infomation Tech presentation.pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
System and Network Administraation Chapter 3
PPT
Introduction Database Management System for Course Database
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Transform Your Business with a Software ERP System
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Upgrade and Innovation Strategies for SAP ERP Customers
Online Work Permit System for Fast Permit Processing
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Essential Infomation Tech presentation.pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03
System and Network Administraation Chapter 3
Introduction Database Management System for Course Database
PTS Company Brochure 2025 (1).pdf.......
Transform Your Business with a Software ERP System
Which alternative to Crystal Reports is best for small or large businesses.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Operating system designcfffgfgggggggvggggggggg
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
How to Migrate SBCGlobal Email to Yahoo Easily
ManageIQ - Sprint 268 Review - Slide Deck
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Ad

USING GRAALVM IN PRODUCTION - JAVAONE.pdf

  • 1. Alina Yurenko Using GraalVM in Production Oracle
  • 2. About me • Alina Yurenko / @alina_yurenko • Developer Advocate for GraalVM at Oracle • Love open source and communities 🤝 • Love both programming 👩💻 & natural languages 🗣 @alina_yurenko
  • 4. An advanced JDK with AOT Native Image compilation
  • 6. 2017 2018 2019 2020 2021 2022 2023 2005 2011 ... ... Graal History Sun Labs’ Maxine Java JVM initial release December Native Image open sourced April Twitter uses Graal JIT for core microservices October Micronaut 1.0 with Native Image support April GraalVM 1.0 released April Thomas Wuethinger joins Oracle and starts Graal compiler project September Spring Native project launched November Quarkus 1.0 with Native Image support May GraalVM Enterprise Edition 19 Product Released September MicroDoc announces GraalVM for embedded July Alibaba start using Native Image in production July Facebook deploys GraalVM in production May AWS SDK support for Native Image November Spring Boot 3 with Native Image support December OpenJDK Galahad project proposed July Google Cloud Platform SDK support for Native Image June GraalVM Free Terms and Conditions license September GraalOS & Layered Native Image announced March Azure SDK support for Native Image 2024 October Microsoft joins GraalVM Advsory Board September GraalPy & GraalWasm production ready 🎉 🎉 🎉 🎉
  • 7. GraalVM Native Image AOT Compilation Ahead-of-Time Compilation Application Libraries JDK Substrate VM Points-to Analysis Run Initializations Heap Snapshotting Input: All classes from application, libraries, and VM Code in Text Section Image Heap in Data Section Image Heap Writing Output: Native executable @alina_yurenko
  • 9. GraalVM Native Image—Fast Start Up and Much More Improved Security Fast Start & Scale Lower Resource Usage Compact Packaging Predictable Performance Wide Ecosystem Azure AWS GCP OCI @alina_yurenko
  • 11. NATIVE IMAGE BUILD-TIME DISCOVERY AND CONFIGURATION SPRING BOOT RUN-TIME DISCOVERY AND CONFIGURATION
  • 12. SPRING BOOT NATIVE IMAGE SPRING AOT
  • 14. SPRING AOT JAVA SOURCE FILES BYTECODE HINT FILES
  • 15. 200+ libraries and frameworks integrating and testing with Native Image Ready for GraalVM Native Image graalvm.org/native-image/libraries-and-frameworks @alina_yurenko
  • 16. Libraries, dynamic Java features, and Native Image • Libraries might be Native-Image friendly out of the box • twitter.com/YunaMorgenstern/status/1729039787351536084 • Libraries might include config for Native Image: • github.com/h2database/h2database/blob/master/h2/src/main/META-INF/native-image/ • Libraries might contain config in the Reachability Metadata Repository • github.com/oracle/graalvm-reachability-metadata/tree/master/metadata/io.netty • You can use framework support to produce custom “hints” for Native Image runtimeHints.resources().registerPattern(“config/app.properties”); • You can use the Tracing Agent to produce the necessary config automatically • graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/ • You can provide/extend config for reflection, JNI, resources, serialization, and predefined classes manually in JSON: • graalvm.org/latest/reference-manual/native-image/metadata/#specifying-metadata-with-json Happy path; most of the cases Custom code/ libraries @alina_yurenko
  • 19. AOT at the speed of JIT 🚀 • Profile-guided optimizations Collect and use profiles to optimize for the specific runtime behaviour of your application • ML-enabled PGO Use a ML model to automatically predict the profile of the application • G1 GC Optimize GC for peak throughput and improved latency • `-march=native` Optimize for the specific hardware features of the machine you’ll be running on @alina_yurenko
  • 22. Container Size (MB) 0 125 250 375 500 Debian 12-slim + JDK 21 Distroless Java 21 Distroless Java Base + jlink Distroless Java Base + Native Image Distroless Base + Native Image Distroless Static + Native Image 18.1 36.3 48.9 127 199 405 95.5% container image size reduction JDK’s Simple Web Server GraalVM Native Image JVM Compact Packaging @alina_yurenko
  • 23. Cross-Platform Builds on GitHub Actions Windows Executable macOS Executable Linux Executable .class .jar .class .jar GraalVM GitHub Action 🏗 @alina_yurenko
  • 24. Recommendations • Migrate 🚀 • Add Native Build Tools • Alternatively, use recent versions of frameworks • Evaluate libraries: graalvm.org/native-image/libraries-and-frameworks • Build and deploy 👷 • Build and test on GraalVM as the JVM, build with Native Image closer to the deployment • Quick build mode with `-Ob` • Use CI/CD systems (e.g. GitHub actions) for deployment and cross-platform builds • Monitor • jvmstat, JFR, JMX, Micrometer, cloud vendor solutions • Run faster 🚀 • PGO • ML-enabled PGO • G1 GC • `-march=native` @alina_yurenko
  • 26. • Reduced attack surface area due to dead code removal— unused classes, methods, and fields not included in executable Improved Security • Not vulnerable to JIT compiler attacks all code is AOT compiled • SBOM supporting industry standards Embedded in executables CycloneDX format • Not vulnerable to deserialization attacks via class loading—executable includes only required and specified classes Reduced Attack Surface 🛡 @alina_yurenko
  • 28. GraalVM for JDK 24 🚀 • Java 24 features 😍 • The fastest GraalVM yet :) • New ML profile inference for even higher performance out of the box 🤖 • Smaller executables 📦 • Vector API support in Native Image 🚀 • New SBOM features 🛡 • Developer experience improvements 👩💻 Learn more: medium.com/graalvm @alina_yurenko
  • 29. sdk install java 24-graal Get started with GraalVM 🚀 graalvm.org github.com/graalvm/ graalvm-demos docker pull container- registry.oracle.com/ graalvm/jdk:24 @alina_yurenko
  • 30. Questions & let’s connect! Demos 👩💻 @alina_yurenko