尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
@alina_yurenko
#DevoxxPL
Going AOT: Everything you
need to know about GraalVM
for Java applications
Alina Yurenko
Oracle
Platinum
Sponsors
• Alina Yurenko / @alina_yurenko
• Developer Advocate for GraalVM
at Oracle
• Love open source and
communities 🤝
• Love both programming 👩💻 &
natural languages 🗣
•🐱🐶
About me
GRAALVM
An advanced JDK with ahead-of-time
Native Image compilation
native-image MyMainClass
./mymainclass
JIT AOT
java MyMainClass
2017 Year
2018 2019 2020 2021 2022 2023
2005 2011
... ...
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
Wuerthinger
joins Oracle and
starts Graal
compiler project
March
Spring Native
goes beta
November
Quarkus
1.0 with
Native
Image
support
May
GraalVM
goes GA
(19.0
release)
September
MicroDoc
announces
GraalVM for
embedded
July
Alibaba
deploys
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
September
Oracle Cloud
runs services
on GraalVM
Graal History
🎉
🎉
🎉
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
• shift work to build time 🏗️
• closed-world assumption 🔮
DEMO 🚀
GraalVM Native Image—Fast Start Up and Much More
Improved
Security
Fast Start
& Scale
Lower Resource
Usage
Compact
Packaging
Predictable
Performance
Supported
Azure
AWS
GCP
OCI
NATIVE IMAGE, LIBR
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
• shift work to build time 🏗️
• closed-world assumption 🔮
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
MORE DEMOS:)
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
Ready for GraalVM Native Image
graalvm.org/native-image/libraries-and-frameworks
PERFORMANCE
AOT at the speed of JIT 🚀
• Profile-guided optimizations
Collect and use profiles at build
time 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
• `-march=native`
Optimize for the specific
hardware features of the machine
you’ll be running on
Spring PetClinic: Memory Efficiency
Spring PetClinic Performance on Oracle GraalVM
GraalVM CE with C2 JIT Oracle GraalVM Native Image
Memory Usage (max RSS) 1,029 MB 641 MB
Peak throughput 11,066 req/s 11,902 req/s
Throughput per memory 12,488 req/(GB*s) 18,569 req/(GB*s)
Tail latency (P99) 7.2ms 5.15ms
Startup 7,090ms 210ms
-38% lower
+8% higher
+49% better
-28% lower
34x faster
BEST PRACTICES
Cross-Platform Builds on GitHub Actions
Windows
Executable
macOS
Executable
Linux
Executable
.class
.jar
.class
.jar
GraalVM GitHub
Action 🏗🤝
• 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
• Run faster 🚀
• PGO
• ML-enabled PGO
• G1 GC
• `-march=native`
Recommendations
WHAT’S NEXT?
• Java 22 features
• The fastest GraalVM yet :)
• Developer experience improvements
Learn more: medium.com/graalvm
GraalVM for JDK 22 🚀
Layered Native Images
Micronaut base
Micronaut extensions
(Web, Data, Test)
Spring base
App 1
App 2 App 3
Deployment: resources sharing ☁️
JDK base
Application code
Development: fast recompilation 🚀
JDK base + Micronaut base+ all
extensions
App 4
GraalOS—Advanced cloud native application deployment platform
Fast Start
GraalOS applications
start fast with virtually
no cold start cost
Low Latency
Excellent 99th
percentile latency
makes GraalOS
applications highly
responsive
Run On Demand
GraalOS applications
are automatically
suspended and
resumed on
demand—with no idle
cost
Applications, not
Containers
GraalOS uses the latest
advances in x86 and
AArch64 processor
architectures for hardware
enforced application
isolation without containers
Reduced Memory
GraalOS applications
require significantly
less memory resulting
in reduced operating
costs
Cloud Native
With support for
stateful and stateless
services and
functions, GraalOS is
ideal for cloud native
applications
Runs applications as small, fast GraalVM Native Image compiled machine executables
Compact
Packaging
GraalVM Native Image—Ideal for Cloud Native Applications
Improved
Security
Fast Start
& Scale
Lower Resource
Usage
Predictable
Performance
Supported
Azure
AWS
GCP
OCI
Questions & let’s connect! Demos 👩💻
Please rate this session :) 🐈
Many thanks!:)
@alina_yurenko
Going AOT: Everything you need to know about GraalVM for Java applications

More Related Content

Similar to Going AOT: Everything you need to know about GraalVM for Java applications

AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0
MoritzHalbritter
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
Bruno Borges
 
GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
scalaconfjp
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
graemerocher
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdf
ohupalo
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
Ruslan Meshenberg
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
Justin Ryan
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
Anatole Tresch
 
DevOps environment with OpenStack and NetApp
DevOps environment with OpenStack and NetAppDevOps environment with OpenStack and NetApp
DevOps environment with OpenStack and NetApp
B1 Systems GmbH
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
Mohit Gupta
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Lennon Shimokawa
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
Daniel Woods
 
Modern Web Framework : Play framework
Modern Web Framework : Play frameworkModern Web Framework : Play framework
Modern Web Framework : Play framework
Suman Adak
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
Taro L. Saito
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
Jeevesh Pandey
 
Eclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – HelidonEclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – Helidon
Oracle Korea
 
Front-End Tools and Workflows
Front-End Tools and WorkflowsFront-End Tools and Workflows
Front-End Tools and Workflows
Sara Vieira
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
Red Hat Developers
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
Sudar Muthu
 

Similar to Going AOT: Everything you need to know about GraalVM for Java applications (20)

AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0AOT and Native with Spring Boot 3.0
AOT and Native with Spring Boot 3.0
 
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX AppsFrom GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
From GitHub Source to GitHub Release: Free CICD Pipelines For JavaFX Apps
 
GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdf
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Netflix oss season 2 episode 1 - meetup Lightning talks
Netflix oss   season 2 episode 1 - meetup Lightning talksNetflix oss   season 2 episode 1 - meetup Lightning talks
Netflix oss season 2 episode 1 - meetup Lightning talks
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
 
Microservices in Java
Microservices in JavaMicroservices in Java
Microservices in Java
 
DevOps environment with OpenStack and NetApp
DevOps environment with OpenStack and NetAppDevOps environment with OpenStack and NetApp
DevOps environment with OpenStack and NetApp
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Building Web Apps in Ratpack
Building Web Apps in RatpackBuilding Web Apps in Ratpack
Building Web Apps in Ratpack
 
Modern Web Framework : Play framework
Modern Web Framework : Play frameworkModern Web Framework : Play framework
Modern Web Framework : Play framework
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Eclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – HelidonEclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – Helidon
 
Front-End Tools and Workflows
Front-End Tools and WorkflowsFront-End Tools and Workflows
Front-End Tools and Workflows
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
 
Using Javascript in today's world
Using Javascript in today's worldUsing Javascript in today's world
Using Javascript in today's world
 

Recently uploaded

Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
sapnasaifi408
 
Extreme DDD Modelling Patterns - 2024 Devoxx Poland
Extreme DDD Modelling Patterns - 2024 Devoxx PolandExtreme DDD Modelling Patterns - 2024 Devoxx Poland
Extreme DDD Modelling Patterns - 2024 Devoxx Poland
Alberto Brandolini
 
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable PriceCall Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
vickythakur209464
 
Photo Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdfPhoto Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdf
SERVE WELL CRM NASHIK
 
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptxSAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
aneeshmanikantan2341
 
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
ns9201415
 
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
manji sharman06
 
Introduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptxIntroduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptx
GevitaChinnaiah
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
confluent
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
michniczscribd
 
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdfThe Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
kalichargn70th171
 
What’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 UpdateWhat’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 Update
VictoriaMetrics
 
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
sapnasaifi408
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
wonyong hwang
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
anshsharma8761
 
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
tinakumariji156
 
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
Shane Coughlan
 
119321250-History-of-Computer-Programming.ppt
119321250-History-of-Computer-Programming.ppt119321250-History-of-Computer-Programming.ppt
119321250-History-of-Computer-Programming.ppt
lavesingh522
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
servicesNitor
 

Recently uploaded (20)

Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
Independent Call Girls In Bangalore 💯Call Us 🔝 7426014248 🔝Independent Bangal...
 
Extreme DDD Modelling Patterns - 2024 Devoxx Poland
Extreme DDD Modelling Patterns - 2024 Devoxx PolandExtreme DDD Modelling Patterns - 2024 Devoxx Poland
Extreme DDD Modelling Patterns - 2024 Devoxx Poland
 
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable PriceCall Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
Call Girls in Varanasi || 7426014248 || Quick Booking at Affordable Price
 
Photo Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdfPhoto Copier Xerox Machine annual maintenance contract system.pdf
Photo Copier Xerox Machine annual maintenance contract system.pdf
 
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptxSAP ECC & S4 HANA PPT COMPARISON MM.pptx
SAP ECC & S4 HANA PPT COMPARISON MM.pptx
 
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
Hot Call Girls In Ahmedabad ✔ 7737669865 ✔ Hi I Am Divya Vip Call Girl Servic...
 
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
Call Girls Bangalore🔥7023059433🔥Best Profile Escorts in Bangalore Available 24/7
 
Introduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptxIntroduction to Python and Basic Syntax.pptx
Introduction to Python and Basic Syntax.pptx
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
 
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdfThe Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
The Ultimate Guide to Top 36 DevOps Testing Tools for 2024.pdf
 
What’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 UpdateWhat’s new in VictoriaMetrics - Q2 2024 Update
What’s new in VictoriaMetrics - Q2 2024 Update
 
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
Hi-Fi Call Girls In Hyderabad 💯Call Us 🔝 7426014248 🔝Independent Hyderabad Es...
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
Call Girls Solapur ☎️ +91-7426014248 😍 Solapur Call Girl Beauty Girls Solapur...
 
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
🔥 Chennai Call Girls  👉 6350257716 👫 High Profile Call Girls Whatsapp Number ...
 
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
OpenChain Webinar - Open Source Due Diligence for M&A - 2024-06-17
 
119321250-History-of-Computer-Programming.ppt
119321250-History-of-Computer-Programming.ppt119321250-History-of-Computer-Programming.ppt
119321250-History-of-Computer-Programming.ppt
 
Hands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion StepsHands-on with Apache Druid: Installation & Data Ingestion Steps
Hands-on with Apache Druid: Installation & Data Ingestion Steps
 

Going AOT: Everything you need to know about GraalVM for Java applications

  • 1. @alina_yurenko #DevoxxPL Going AOT: Everything you need to know about GraalVM for Java applications Alina Yurenko Oracle Platinum Sponsors
  • 2. • Alina Yurenko / @alina_yurenko • Developer Advocate for GraalVM at Oracle • Love open source and communities 🤝 • Love both programming 👩💻 & natural languages 🗣 •🐱🐶 About me
  • 4. An advanced JDK with ahead-of-time Native Image compilation
  • 6. 2017 Year 2018 2019 2020 2021 2022 2023 2005 2011 ... ... 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 Wuerthinger joins Oracle and starts Graal compiler project March Spring Native goes beta November Quarkus 1.0 with Native Image support May GraalVM goes GA (19.0 release) September MicroDoc announces GraalVM for embedded July Alibaba deploys 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 September Oracle Cloud runs services on GraalVM Graal History 🎉 🎉 🎉
  • 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 • shift work to build time 🏗️ • closed-world assumption 🔮
  • 9. GraalVM Native Image—Fast Start Up and Much More Improved Security Fast Start & Scale Lower Resource Usage Compact Packaging Predictable Performance Supported Azure AWS GCP OCI
  • 11. 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 • shift work to build time 🏗️ • closed-world assumption 🔮
  • 12. NATIVE IMAGE BUILD-TIME DISCOVERY AND CONFIGURATION SPRING BOOT RUN-TIME DISCOVERY AND CONFIGURATION
  • 13. SPRING BOOT NATIVE IMAGE SPRING AOT
  • 15. SPRING AOT JAVA SOURCE FILES BYTECODE HINT FILES
  • 17. 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
  • 18. Ready for GraalVM Native Image graalvm.org/native-image/libraries-and-frameworks
  • 20. AOT at the speed of JIT 🚀 • Profile-guided optimizations Collect and use profiles at build time 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 • `-march=native` Optimize for the specific hardware features of the machine you’ll be running on
  • 22. Spring PetClinic Performance on Oracle GraalVM GraalVM CE with C2 JIT Oracle GraalVM Native Image Memory Usage (max RSS) 1,029 MB 641 MB Peak throughput 11,066 req/s 11,902 req/s Throughput per memory 12,488 req/(GB*s) 18,569 req/(GB*s) Tail latency (P99) 7.2ms 5.15ms Startup 7,090ms 210ms -38% lower +8% higher +49% better -28% lower 34x faster
  • 24. Cross-Platform Builds on GitHub Actions Windows Executable macOS Executable Linux Executable .class .jar .class .jar GraalVM GitHub Action 🏗🤝
  • 25. • 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 • Run faster 🚀 • PGO • ML-enabled PGO • G1 GC • `-march=native` Recommendations
  • 27. • Java 22 features • The fastest GraalVM yet :) • Developer experience improvements Learn more: medium.com/graalvm GraalVM for JDK 22 🚀
  • 28. Layered Native Images Micronaut base Micronaut extensions (Web, Data, Test) Spring base App 1 App 2 App 3 Deployment: resources sharing ☁️ JDK base Application code Development: fast recompilation 🚀 JDK base + Micronaut base+ all extensions App 4
  • 29. GraalOS—Advanced cloud native application deployment platform Fast Start GraalOS applications start fast with virtually no cold start cost Low Latency Excellent 99th percentile latency makes GraalOS applications highly responsive Run On Demand GraalOS applications are automatically suspended and resumed on demand—with no idle cost Applications, not Containers GraalOS uses the latest advances in x86 and AArch64 processor architectures for hardware enforced application isolation without containers Reduced Memory GraalOS applications require significantly less memory resulting in reduced operating costs Cloud Native With support for stateful and stateless services and functions, GraalOS is ideal for cloud native applications Runs applications as small, fast GraalVM Native Image compiled machine executables
  • 30. Compact Packaging GraalVM Native Image—Ideal for Cloud Native Applications Improved Security Fast Start & Scale Lower Resource Usage Predictable Performance Supported Azure AWS GCP OCI
  • 31. Questions & let’s connect! Demos 👩💻
  • 32. Please rate this session :) 🐈

Editor's Notes

  1. What is GraalOS?   GraalOS is a high performance serverless Java-based application deployment platform. It uses GraalVM Native Image to run your application as a native machine executable—taking full advantage of the latest x64 and AArch64 processor features available on Oracle Cloud Infrastructure (OCI). An application deployed to GraalOS will be less expensive to operate and help reduce your cloud costs. Fast Start A GraalOS application starts fast with virtually no “cold start” cost. Unlike container-based platforms that suffer from significant cold start costs, a GraalOS application is a small native Linux executable that starts in 10s of milliseconds. Reduced Memory A GraalOS application requires significantly less memory thanks to GraalVM Native Image ahead-of-time (AOT) compilation. In turn, lower memory usage has a direct impact on your operating costs: pricing structures for most cloud services, including OCI Functions, have a significant memory usage element. GraalOS can typically reduce your application memory by at least 50%. Run On Demand A GraalOS application is automatically suspended and resumed when called—with no idle cost. Applications and functions that are not receiving requests are terminated on most serverless platforms after a timeout period has been exceeded. An application that is subsequently invoked is subject to a cold start cost. GraalOS’s ability to suspend and rapidly resume your idle applications means no cold start. Applications, not Containers GraalOS runs native Linux executables directly—taking advantage of the latest advances in hardware-enforced application isolation. This approach removes the need to package your application into a container, which eliminates challenges such as selecting a secure container image and ensuring that the latest security patches are in place and updated regularly. Cloud Native With support for stateful and stateless microservices and functions, GraalOS is ideal for cloud native applications. Both short-lived functions and long-running microservices will benefit from GraalOS features such as virtually no cold start, transparent suspend and resume, and no cost idle. OCI Functions Powered by GraalOS  The first use of GraalOS is in OCI Functions: it will add a new “Graal Function” type that will start much faster and require less memory than existing OCI functions. Thanks to the built-in OCI Functions triggers provided by OCI services such as Events, Connector Hub, Data Integration, API Gateway, and Notifications, all these services will be able to take advantage of GraalOS-powered functions with no changes. To learn more, see Rishikesh Palve’s blog “Ultra-fast Serverless Functions Powered by GraalOS”.
  翻译: