SlideShare a Scribd company logo
All you need to know about
Spring Boot and GraalVM
Alina Yurenko
Oracle
• Alina Yurenko / @alina_yurenko
• Developer Advocate for GraalVM
at Oracle
• Love open source and
communities 🤝
• Love both programming 👩💻 &
natural languages 🗣
•🐱🐶
About me
All you need to know about Spring Boot and GraalVM
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
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
SPRING AOT
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: Peak throughput
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 🏗🤝
Build container images with GraalVM and Buildpacks
• Add to your pom.xml:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<!-- ... -->
<buildpacks>
<buildpack>docker.io/paketobuildpacks/oracle</buildpack>
<buildpack>urn:cnb:builder:paketo-buildpacks/java-native-image</buildpack>
</buildpacks>
</image>
</configuration>
</plugin>
• Build the image:
./mvnw -Pnative spring-boot:build-image
• 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 🛡️
• 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
graalvm.org
sdk install java
22.0.1-graal
Get started with GraalVM 🚀
github.com/graalvm/g
raalvm-demos
docker pull container-
registry.oracle.com/gra
alvm/jdk:22
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Questions & let’s connect! Demos 👩💻
Please rate this session!:) 🐈
Dank je wel!:)
@alina_yurenko
45
All you need to know about Spring Boot and GraalVM

More Related Content

Similar to All you need to know about Spring Boot and GraalVM

GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
scalaconfjp
 
GraalVM
GraalVMGraalVM
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
 
GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22
Jorge Hidalgo
 
GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18
Jorge Hidalgo
 
Quarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdfQuarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdf
Ivelin Yanev
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
Soham Dasgupta
 
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
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
Ryan Cuprak
 
Neptue Graph Database - 0 to Production
Neptue Graph Database - 0 to ProductionNeptue Graph Database - 0 to Production
Neptue Graph Database - 0 to Production
israelio
 
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
 
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
 
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISEDEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
European Collaboration Summit
 
GraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM PresentationGraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM Presentation
Knoldus Inc.
 
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
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
graemerocher
 
Use Cases of #Grails in #WebApplications
Use Cases of #Grails in #WebApplicationsUse Cases of #Grails in #WebApplications
Use Cases of #Grails in #WebApplications
Xebia IT Architects
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
rajdeep
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
Lennon Shimokawa
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
Taro L. Saito
 

Similar to All you need to know about Spring Boot and GraalVM (20)

GraalVM Overview Compact version
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
 
GraalVM
GraalVMGraalVM
GraalVM
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22GraalVM - MadridJUG 2019-10-22
GraalVM - MadridJUG 2019-10-22
 
GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18GraalVM - OpenSlava 2019-10-18
GraalVM - OpenSlava 2019-10-18
 
Quarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdfQuarkus Extensions Turbocharge for Java Microservices.pdf
Quarkus Extensions Turbocharge for Java Microservices.pdf
 
GraphQL-ify your APIs
GraphQL-ify your APIsGraphQL-ify your APIs
GraphQL-ify your APIs
 
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
 
Polygot Java EE on the GraalVM
Polygot Java EE on the GraalVMPolygot Java EE on the GraalVM
Polygot Java EE on the GraalVM
 
Neptue Graph Database - 0 to Production
Neptue Graph Database - 0 to ProductionNeptue Graph Database - 0 to Production
Neptue Graph Database - 0 to Production
 
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
 
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
 
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISEDEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
 
GraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM PresentationGraalVM - A Step Ahead of JVM Presentation
GraalVM - A Step Ahead of JVM Presentation
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
 
Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019Micronaut Deep Dive - Devoxx Belgium 2019
Micronaut Deep Dive - Devoxx Belgium 2019
 
Use Cases of #Grails in #WebApplications
Use Cases of #Grails in #WebApplicationsUse Cases of #Grails in #WebApplications
Use Cases of #Grails in #WebApplications
 
Cloudfoundry Overview
Cloudfoundry OverviewCloudfoundry Overview
Cloudfoundry Overview
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Tips For Maintaining OSS Projects
Tips For Maintaining OSS ProjectsTips For Maintaining OSS Projects
Tips For Maintaining OSS Projects
 

Recently uploaded

Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
kiara pandey
 
07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching
quanhoangd129
 
Tour and travel website management in odoo,
Tour and travel website management in odoo,Tour and travel website management in odoo,
Tour and travel website management in odoo,
Axis Technolabs
 
UMiami degree offer diploma Transcript
UMiami degree offer diploma TranscriptUMiami degree offer diploma Transcript
UMiami degree offer diploma Transcript
attueb
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
attueb
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
3610stuck
 
How to Secure Your Kubernetes Software Supply Chain at Scale
How to Secure Your Kubernetes Software Supply Chain at ScaleHow to Secure Your Kubernetes Software Supply Chain at Scale
How to Secure Your Kubernetes Software Supply Chain at Scale
Anchore
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
45unexpected
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
dream girl
 
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
87tomato
 
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdfA Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
kalichargn70th171
 
06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching
quanhoangd129
 
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
andrehoraa
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
quanhoangd129
 
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
andrehoraa
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
6m9p7qnjj8
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
revolutionary575
 
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
OnePlan Solutions
 
Predicting Test Results without Execution (FSE 2024)
Predicting Test Results without Execution (FSE 2024)Predicting Test Results without Execution (FSE 2024)
Predicting Test Results without Execution (FSE 2024)
andrehoraa
 
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
singhlata50dh
 

Recently uploaded (20)

Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9930687706 Unlimited Short Providing Girls Servic...
 
07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching07. Ruby String Slides - Ruby Core Teaching
07. Ruby String Slides - Ruby Core Teaching
 
Tour and travel website management in odoo,
Tour and travel website management in odoo,Tour and travel website management in odoo,
Tour and travel website management in odoo,
 
UMiami degree offer diploma Transcript
UMiami degree offer diploma TranscriptUMiami degree offer diploma Transcript
UMiami degree offer diploma Transcript
 
GT degree offer diploma Transcript
GT degree offer diploma TranscriptGT degree offer diploma Transcript
GT degree offer diploma Transcript
 
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
Mumbai Girls Call Mumbai 🎈🔥9930687706 🔥💋🎈 Provide Best And Top Girl Service A...
 
How to Secure Your Kubernetes Software Supply Chain at Scale
How to Secure Your Kubernetes Software Supply Chain at ScaleHow to Secure Your Kubernetes Software Supply Chain at Scale
How to Secure Your Kubernetes Software Supply Chain at Scale
 
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
Celebrity Girls Call Mumbai 9920725232 Unlimited Short Providing Girls Servic...
 
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
Russian Girls Call Mumbai 🛵🚡9833363713 💃 Choose Best And Top Girl Service And...
 
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
Verified Girls Call Mumbai 👀 9820252231 👀 Cash Payment With Room DeliveryDeli...
 
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdfA Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
A Step-by-Step Guide to Selecting the Right Automated Software Testing Tools.pdf
 
06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching06. Ruby Array & Hash - Ruby Core Teaching
06. Ruby Array & Hash - Ruby Core Teaching
 
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
Test Polarity: Detecting Positive and Negative Tests (FSE 2024)
 
05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching05. Ruby Control Structures - Ruby Core Teaching
05. Ruby Control Structures - Ruby Core Teaching
 
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
PathSpotter: Exploring Tested Paths to Discover Missing Tests (FSE 2024)
 
Fantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdfFantastic Design Patterns and Where to use them No Notes.pdf
Fantastic Design Patterns and Where to use them No Notes.pdf
 
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
Busty Girls Call Mumbai 9930245274 Unlimited Short Providing Girls Service Av...
 
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
Maximizing Efficiency and Profitability: Optimizing Data Systems, Enhancing C...
 
Predicting Test Results without Execution (FSE 2024)
Predicting Test Results without Execution (FSE 2024)Predicting Test Results without Execution (FSE 2024)
Predicting Test Results without Execution (FSE 2024)
 
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
High Girls Call Chennai 000XX00000 Provide Best And Top Girl Service And No1 ...
 

All you need to know about Spring Boot and GraalVM

  • 1. All you need to know about Spring Boot and GraalVM Alina Yurenko Oracle
  • 2. • Alina Yurenko / @alina_yurenko • Developer Advocate for GraalVM at Oracle • Love open source and communities 🤝 • Love both programming 👩💻 & natural languages 🗣 •🐱🐶 About me
  • 5. An advanced JDK with ahead-of-time Native Image compilation
  • 7. 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 🎉 🎉 🎉 🎉
  • 8. 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
  • 10. 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
  • 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
  • 23. 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
  • 25. Cross-Platform Builds on GitHub Actions Windows Executable macOS Executable Linux Executable .class .jar .class .jar GraalVM GitHub Action 🏗🤝
  • 26. Build container images with GraalVM and Buildpacks • Add to your pom.xml: <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <image> <!-- ... --> <buildpacks> <buildpack>docker.io/paketobuildpacks/oracle</buildpack> <buildpack>urn:cnb:builder:paketo-buildpacks/java-native-image</buildpack> </buildpacks> </image> </configuration> </plugin> • Build the image: ./mvnw -Pnative spring-boot:build-image
  • 27. • 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 🛡️
  • 28. • 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
  • 30. • Java 22 features • The fastest GraalVM yet :) • Developer experience improvements Learn more: medium.com/graalvm GraalVM for JDK 22 🚀
  • 31. 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
  • 32. 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
  • 33. 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
  • 34. graalvm.org sdk install java 22.0.1-graal Get started with GraalVM 🚀 github.com/graalvm/g raalvm-demos docker pull container- registry.oracle.com/gra alvm/jdk:22
  • 37. Questions & let’s connect! Demos 👩💻
  • 38. 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”.