SlideShare a Scribd company logo
1 of 53
Download to read offline
A Glance at
The Java Performance
Toolbox
Java Champion Alumni, Certified Architect
Senior Developer Advocate at Oracle
“DevOps Tools for Java Developers” guest author
ammbra1508 ammbra1508.mastondon.social
What does application
performance mean?
Performance experienced
by end-users
Computational resources used by the
application
Performance Metrics
CPU Usage
Memory Usage
Error rates
User satisfaction (Apdex scores)
Average response time
Request rates
Latency and uptime
Throughput
More Questions Using Java Applications in
Containers
• Which JDK tools help you create container images with only what is needed at runtime?
• How to run the JDK tools in containers and proxy their output?
• Which tools help you fine tune the JVM flags and keep application overhead at minimum?
• How to capture performance relevant JVM and application events?
• How to correlate data from JVM monitoring tools with the one from tools like Prometheus,
Grafana?
Which tools help you create
container images with only what
is needed at runtime?
Tools to build an OCI Compliant Image
• Docker build
• Buildpacks
• Jib
• kaniko
• buildah
• s2i
• And many more J
The Good Old Dockerfile
FROM openjdk:10-jre-slim
# Continue with your application deployment
COPY ./target/spring-todo-app.jar /app.jar
COPY entrypoint.sh /entrypoint.sh
RUN groupadd -r appuser && useradd -r -g appuser appuser
RUN chmod +x /entrypoint.sh
USER appuser
CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"]
The Good Old Dockerfile
FROM openjdk:10-jre-slim
# Continue with your application deployment
COPY ./target/spring-todo-app.jar /app.jar
COPY entrypoint.sh /entrypoint.sh
RUN groupadd -r appuser && useradd -r -g appuser appuser
RUN chmod +x /entrypoint.sh
USER appuser
CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"]
Use a small base image
Create images with common layers
The Good Old Dockerfile
FROM openjdk:10-jre-slim
# Continue with your application deployment
COPY ./target/spring-todo-app.jar /app.jar
COPY entrypoint.sh /entrypoint.sh
RUN groupadd -r appuser && useradd -r -g appuser appuser
RUN chmod +x /entrypoint.sh
USER appuser
CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"]
Install only what is strictly needed
JDK tools that shape
efficient Java Runtimes for
Container Images
Jlink
JEP 282 “Link time is an opportunity to do whole-world optimizations that are
otherwise difficult at compile time or costly at run-time”
jlink: Command Line Tool to Link Modules
• Modules in a jimage file
• Generate runtime images
Jlink Packaging
Legacy JDK image
JDK > 9 generated image
bin jre lib
bin conf ……..
Modular runtime image
jlink
Maintain The Good Old Dockerfile with jlink
The runtime stage build
• From a JDK base image
• Create your own custom JRE with jlink
Maintain The Good Old Dockerfile with jlink
The runtime stage build
• From a JDK base image
• Create your own custom JRE with jlink
The application stage build
• From an OS base image
• Copy the custom JRE from the runtime stage build
• Copy the artifacts needed by your application
• Run the application
The Runtime Stage Build
FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build
# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink 
--add-modules <modules> 
--no-man-pages 
--no-header-files 
--compress=zip-9 
--output /javaruntime
jdeps --ignore-missing-deps -q -recursive 
--multi-release 21 --print-module-deps 
--class-path 'target/libs/*’ 
target/spring-todo-app.jar
The Runtime Stage Build
FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build
# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink 
--add-modules <modules> 
--no-man-pages 
--no-header-files 
--compress=zip-9 
--output /javaruntime
Exclude man pages and header files
The Runtime Stage Build
FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build
# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink 
--add-modules <modules> 
--no-man-pages 
--no-header-files 
--compress=zip-9 
--output /javaruntime
Enable compression of resources zip[0-9]:
zip-0: No compression
zip-6: Default value
zip-9: Best compression
The Application Stage Build
FROM oraclelinux:8-slim
ENV JAVA_HOME /usr/java/openjdk-21
ENV PATH $JAVA_HOME/bin:$PATH
COPY --from=jre-build /javaruntime $JAVA_HOME
# Continue with your application deployment
ENV JDK_JAVA_OPTIONS "--enable-preview"
CMD ["/entrypoint.sh"]
Copy the custom JRE
The Application Stage Build
FROM oraclelinux:8-slim
ENV JAVA_HOME /usr/java/openjdk-21
ENV PATH $JAVA_HOME/bin:$PATH
COPY --from=jre-build /javaruntime $JAVA_HOME
# Continue with your application deployment
ENV JDK_JAVA_OPTIONS "--enable-preview"
CMD ["/entrypoint.sh"]
Copy the artifacts needed by
your application
The Application Stage Build
FROM oraclelinux:8-slim
ENV JAVA_HOME /usr/java/openjdk-21
ENV PATH $JAVA_HOME/bin:$PATH
COPY --from=jre-build /javaruntime $JAVA_HOME
# Continue with your application deployment
ENV JDK_JAVA_OPTIONS "--enable-preview"
CMD ["/entrypoint.sh"] Run the application
How about fine tuning
JVM Flags?
Conserving Dynamic Footprint by
Minimizing Java Heap Size
Start by looking at the JVM ergonomics
Conserving Dynamic Footprint by
Minimizing Java Heap Size
Start by looking at the JVM ergonomics
At initialization of the virtual machine, the entire space for the heap is reserved.
Eg: setting for minimum and maximum heap size: -Xms768m -Xmx768m
Conserving Dynamic Footprint by
Minimizing Java Heap Size
Start by looking at the JVM ergonomics
At initialization of the virtual machine, the entire space for the heap is reserved.
Eg: setting for minimum and maximum heap size: -Xms768m -Xmx768m
Minimize Java heap size by lowering the values of the options:
• -XX:MaxHeapFreeRatio (default value is 70%)
-XX:MinHeapFreeRatio (default value is 40%)
• Eg:-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=70
What if the problem is not
the amount of resources
allocated to/by the JVM?
Tracking Native Memory With jcmd
FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build
# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink 
--add-modules <modules, jdk.jcmd> 
--no-man-pages 
--no-header-files 
--compress=zip-9 
--output /javaruntime
Add jdk.jcmd module
Tracking Native Memory With jcmd
WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM.
Tracking Native Memory With jcmd
WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM.
Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS
• kubectl set env deployment/app JDK_JAVA_OPTIONS=“-XX:NativeMemoryTracking=summary”
• Please consider that having NMT enabled can add application performance overhead.
Tracking Native Memory With jcmd
WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM.
Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS
Create a native memory baseline
kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory baseline"
Tracking Native Memory With jcmd
WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM.
Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS
Create a native memory baseline
kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory baseline"
Create a native memory summary diff
kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory summary.diff"
Performance and
Resource Consumption
Overview information about the Java VM and
monitored values.
Information about memory use.
Information about thread use.
Information about class loading.
Information about the Java VM.
Information about MBeans
Get Statistics About
Running Java Processes
Obtain Statistics with jstat and jmap
Obtain statistics about garbage collectors by running jstat
kubectl exec pod_name –it --/bin/bash -c "jstat -gcutil llvmid 500 50"
Obtain Statistics with jstat and jmap
Obtain statistics about garbage collectors by running jstat
kubectl exec pod_name –it --/bin/bash -c "jstat -gcutil llvmid 500 50"
Print heap summaries
kubectl exec pod_name –it --/bin/bash -c "jmap -histo llvmid"
Capture Performance
Relevant JVM And
Application Events
When to Use Profiling
“To consume the data today, a user must start a recording, stop it, dump the
contents to disk and then parse the recording file. This works well for
application profiling, where typically at least a minute of data is being
recorded at a time, but not for monitoring purposes.“
source: JEP 349
FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build
# Create a custom Java runtime
RUN $JAVA_HOME/bin/jlink 
--add-modules <modules, jdk.jfr> 
--no-man-pages 
--no-header-files 
--compress=zip-9 
--output /javaruntime
Add JFR To Your Container Image
Add jdk.jfr module
How to Use JFR
Enable JFR in JDK_JAVA_OPTIONS
kubectl set env deployment/app JDK_JAVA_OPTIONS=“--XX:StartFlightRecording:..”
For example, start a time fixed recording with default profile
-XX:StartFlightRecording=delay=10s,duration=10m,name=Default,settings=default
Use the diagnostic command:
kubectl exec pod_name –it --/bin/bash -c "jcmd 1 JFR.start…"
Monitor and React
…..
AppTarget 1
AppTarget 2
AppTarget n
Prometheus server
Pull metrics
Pull metrics
Pull metrics
Gathering metrics
Visualizing metrics
Alerting
Streaming selected metrics to your
monitoring service
Where to Use JFR
Streaming
Stream selected metrics to your
monitoring service
Send an average, min, max, etc of a metric
Where to Use JFR
Streaming
Stream selected metrics to your
monitoring service
Send an average, min, max, etc of a metric
Expose JFR data through other
management APIs
Where to Use JFR
Streaming
Make your settings by extending
jdk.jfr.SettingControl
Recording Custom
JFR Events
Make your settings by extending
jdk.jfr.SettingControl
Create your custom event by extending
jdk.jfr.Event
Recording Custom
JFR Events
Recording Custom
JFR Events
Make your settings by extending
jdk.jfr.SettingControl
Create your custom event by extending
jdk.jfr.Event
Register the custom settings in your custom
event via
@jdk.jfr.SettingsDefinition
Recording Custom Events in Spring Boot
(example)
Capture the custom JFR events in a dedicated filter and register it
Recording Custom Events in Spring Boot
(example)
Listen the custom JFR events and record their duration
Thank You!
https://github.com/ammbra/performance-glance
Useful Links
• Article https://www.javaadvent.com/2022/12/a-sneak-peek-at-the-java-performance-toolbox.html
• Tools https://docs.oracle.com/en/java/javase/21/docs/specs/man/index.html
• jlink https://dev.java/learn/jlink/
• Troubleshoot Memory Leaks: https://docs.oracle.com/en/java/javase/21/troubleshoot/troubleshooting-memory-
leaks.html
• Innovative JFR use by @gunnarmorling: https://www.morling.dev/blog/finding-java-thread-leaks-with-jdk-flight-
recorder-and-bit-of-sql/
• @gunnarmorling article on custom JDK Flight Recorder Events
• Great intro by @BillyKorando https://www.youtube.com/watch?v=K1ApBZGiT-Y
• Stack walker episode by @BillyKorando: https://inside.java/2023/05/14/stackwalker-02/

More Related Content

Similar to A Glance At The Java Performance Toolbox

Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insightRyan ZhangCheng
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containersDocker, Inc.
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containersRed Hat Developers
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...London Microservices
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containersinside-BigData.com
 
ContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfSumanMitra22
 
Master your java_applications_in_kubernetes
Master your java_applications_in_kubernetesMaster your java_applications_in_kubernetes
Master your java_applications_in_kubernetesAndy Moncsek
 
Jenkins Pipelines Advanced
Jenkins Pipelines AdvancedJenkins Pipelines Advanced
Jenkins Pipelines AdvancedOliver Lemm
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best PracticesDavid Delabassee
 
Vagrant or docker for java dev environment
Vagrant or docker for java dev environmentVagrant or docker for java dev environment
Vagrant or docker for java dev environmentOrest Ivasiv
 
Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Rafał Leszko
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
DCSF19 Docker Containers & Java: What I Wish I Had Been ToldDCSF19 Docker Containers & Java: What I Wish I Had Been Told
DCSF19 Docker Containers & Java: What I Wish I Had Been ToldDocker, Inc.
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityDanHeidinga
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesTibor Vass
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDocker, Inc.
 
Introduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunIntroduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunSaiyam Pathak
 
Run alone: a standalone application attempt by Gabriel Sor
Run alone: a standalone application attempt by Gabriel SorRun alone: a standalone application attempt by Gabriel Sor
Run alone: a standalone application attempt by Gabriel SorFAST
 

Similar to A Glance At The Java Performance Toolbox (20)

Openshift operator insight
Openshift operator insightOpenshift operator insight
Openshift operator insight
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containers
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
Commit to excellence - Java in containers
Commit to excellence - Java in containersCommit to excellence - Java in containers
Commit to excellence - Java in containers
 
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
Lean microservices through ahead of time compilation (Tobias Piper, Loveholid...
 
DevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux ContainersDevOps Workflow: A Tutorial on Linux Containers
DevOps Workflow: A Tutorial on Linux Containers
 
ContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdfContainerWorkloadwithSemeru.pdf
ContainerWorkloadwithSemeru.pdf
 
Master your java_applications_in_kubernetes
Master your java_applications_in_kubernetesMaster your java_applications_in_kubernetes
Master your java_applications_in_kubernetes
 
Jenkins Pipelines Advanced
Jenkins Pipelines AdvancedJenkins Pipelines Advanced
Jenkins Pipelines Advanced
 
Geode on Docker
Geode on DockerGeode on Docker
Geode on Docker
 
JVMs in Containers - Best Practices
JVMs in Containers - Best PracticesJVMs in Containers - Best Practices
JVMs in Containers - Best Practices
 
Vagrant or docker for java dev environment
Vagrant or docker for java dev environmentVagrant or docker for java dev environment
Vagrant or docker for java dev environment
 
Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!Build Your Kubernetes Operator with the Right Tool!
Build Your Kubernetes Operator with the Right Tool!
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
DCSF19 Docker Containers & Java: What I Wish I Had Been ToldDCSF19 Docker Containers & Java: What I Wish I Had Been Told
DCSF19 Docker Containers & Java: What I Wish I Had Been Told
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
 
DockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best PracticesDockerCon EU 2018 - Dockerfile Best Practices
DockerCon EU 2018 - Dockerfile Best Practices
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
Introduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud RunIntroduction to JIB and Google Cloud Run
Introduction to JIB and Google Cloud Run
 
Run alone: a standalone application attempt by Gabriel Sor
Run alone: a standalone application attempt by Gabriel SorRun alone: a standalone application attempt by Gabriel Sor
Run alone: a standalone application attempt by Gabriel Sor
 

More from Ana-Maria Mihalceanu

Surveillance de la sécurité des applications Java avec les outils du JDK e...
Surveillance de la sécurité des applications Java  avec les outils du JDK e...Surveillance de la sécurité des applications Java  avec les outils du JDK e...
Surveillance de la sécurité des applications Java avec les outils du JDK e...Ana-Maria Mihalceanu
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfAna-Maria Mihalceanu
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17Ana-Maria Mihalceanu
 
Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and BeyondAna-Maria Mihalceanu
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsAna-Maria Mihalceanu
 
Java 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsJava 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsAna-Maria Mihalceanu
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfAna-Maria Mihalceanu
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsAna-Maria Mihalceanu
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upAna-Maria Mihalceanu
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsAna-Maria Mihalceanu
 
The automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsThe automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsAna-Maria Mihalceanu
 
Techniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsTechniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsAna-Maria Mihalceanu
 
Techniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsTechniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsAna-Maria Mihalceanu
 
Five tips for performant microservices on quarkus
Five tips for performant microservices on quarkusFive tips for performant microservices on quarkus
Five tips for performant microservices on quarkusAna-Maria Mihalceanu
 
Tailor metrics-that-matter-with-quarkus
Tailor metrics-that-matter-with-quarkusTailor metrics-that-matter-with-quarkus
Tailor metrics-that-matter-with-quarkusAna-Maria Mihalceanu
 

More from Ana-Maria Mihalceanu (20)

Surveillance de la sécurité des applications Java avec les outils du JDK e...
Surveillance de la sécurité des applications Java  avec les outils du JDK e...Surveillance de la sécurité des applications Java  avec les outils du JDK e...
Surveillance de la sécurité des applications Java avec les outils du JDK e...
 
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdfMonitoring Java Application Security with JDK Tools and JFR Events.pdf
Monitoring Java Application Security with JDK Tools and JFR Events.pdf
 
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17Enhancing Productivity and Insight  A Tour of JDK Tools Progress Beyond Java 17
Enhancing Productivity and Insight A Tour of JDK Tools Progress Beyond Java 17
 
Java 21 Language Features and Beyond
Java 21 Language Features and BeyondJava 21 Language Features and Beyond
Java 21 Language Features and Beyond
 
From Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security EnhancementsFrom Java 17 to 21- A Showcase of JDK Security Enhancements
From Java 17 to 21- A Showcase of JDK Security Enhancements
 
Java 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of InnovationsJava 21 and Beyond- A Roadmap of Innovations
Java 21 and Beyond- A Roadmap of Innovations
 
How Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdfHow Java 19 Influences the Future of Your High-Scale Applications .pdf
How Java 19 Influences the Future of Your High-Scale Applications .pdf
 
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdfThe Automation Challenge Kubernetes Operators vs Helm Charts.pdf
The Automation Challenge Kubernetes Operators vs Helm Charts.pdf
 
Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17Exploring Quarkus on JDK 17
Exploring Quarkus on JDK 17
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
The automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm chartsThe automation challenge Kubernetes operators vs Helm charts
The automation challenge Kubernetes operators vs Helm charts
 
Cloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground upCloud native resiliency patterns from the ground up
Cloud native resiliency patterns from the ground up
 
DevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applicationsDevoxxUK 2021 Techniques for maintainable Quarkus applications
DevoxxUK 2021 Techniques for maintainable Quarkus applications
 
The automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm ChartsThe automation challenge: Kubernetes Operators vs Helm Charts
The automation challenge: Kubernetes Operators vs Helm Charts
 
Techniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsTechniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applications
 
Techniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applicationsTechniques for maintainable Quarkus applications
Techniques for maintainable Quarkus applications
 
Five tips for performant microservices on quarkus
Five tips for performant microservices on quarkusFive tips for performant microservices on quarkus
Five tips for performant microservices on quarkus
 
Tailor metrics-that-matter-with-quarkus
Tailor metrics-that-matter-with-quarkusTailor metrics-that-matter-with-quarkus
Tailor metrics-that-matter-with-quarkus
 

Recently uploaded

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

A Glance At The Java Performance Toolbox

  • 1. A Glance at The Java Performance Toolbox
  • 2. Java Champion Alumni, Certified Architect Senior Developer Advocate at Oracle “DevOps Tools for Java Developers” guest author ammbra1508 ammbra1508.mastondon.social
  • 4. Performance experienced by end-users Computational resources used by the application
  • 5. Performance Metrics CPU Usage Memory Usage Error rates User satisfaction (Apdex scores) Average response time Request rates Latency and uptime Throughput
  • 6.
  • 7. More Questions Using Java Applications in Containers • Which JDK tools help you create container images with only what is needed at runtime? • How to run the JDK tools in containers and proxy their output? • Which tools help you fine tune the JVM flags and keep application overhead at minimum? • How to capture performance relevant JVM and application events? • How to correlate data from JVM monitoring tools with the one from tools like Prometheus, Grafana?
  • 8. Which tools help you create container images with only what is needed at runtime?
  • 9.
  • 10. Tools to build an OCI Compliant Image • Docker build • Buildpacks • Jib • kaniko • buildah • s2i • And many more J
  • 11. The Good Old Dockerfile FROM openjdk:10-jre-slim # Continue with your application deployment COPY ./target/spring-todo-app.jar /app.jar COPY entrypoint.sh /entrypoint.sh RUN groupadd -r appuser && useradd -r -g appuser appuser RUN chmod +x /entrypoint.sh USER appuser CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"]
  • 12. The Good Old Dockerfile FROM openjdk:10-jre-slim # Continue with your application deployment COPY ./target/spring-todo-app.jar /app.jar COPY entrypoint.sh /entrypoint.sh RUN groupadd -r appuser && useradd -r -g appuser appuser RUN chmod +x /entrypoint.sh USER appuser CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"] Use a small base image Create images with common layers
  • 13. The Good Old Dockerfile FROM openjdk:10-jre-slim # Continue with your application deployment COPY ./target/spring-todo-app.jar /app.jar COPY entrypoint.sh /entrypoint.sh RUN groupadd -r appuser && useradd -r -g appuser appuser RUN chmod +x /entrypoint.sh USER appuser CMD ["/entrypoint.sh"] #CMD ["java", "-jar", "app.jar"] Install only what is strictly needed
  • 14. JDK tools that shape efficient Java Runtimes for Container Images
  • 15. Jlink JEP 282 “Link time is an opportunity to do whole-world optimizations that are otherwise difficult at compile time or costly at run-time” jlink: Command Line Tool to Link Modules • Modules in a jimage file • Generate runtime images
  • 16. Jlink Packaging Legacy JDK image JDK > 9 generated image bin jre lib bin conf …….. Modular runtime image jlink
  • 17. Maintain The Good Old Dockerfile with jlink The runtime stage build • From a JDK base image • Create your own custom JRE with jlink
  • 18. Maintain The Good Old Dockerfile with jlink The runtime stage build • From a JDK base image • Create your own custom JRE with jlink The application stage build • From an OS base image • Copy the custom JRE from the runtime stage build • Copy the artifacts needed by your application • Run the application
  • 19. The Runtime Stage Build FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink --add-modules <modules> --no-man-pages --no-header-files --compress=zip-9 --output /javaruntime jdeps --ignore-missing-deps -q -recursive --multi-release 21 --print-module-deps --class-path 'target/libs/*’ target/spring-todo-app.jar
  • 20. The Runtime Stage Build FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink --add-modules <modules> --no-man-pages --no-header-files --compress=zip-9 --output /javaruntime Exclude man pages and header files
  • 21. The Runtime Stage Build FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink --add-modules <modules> --no-man-pages --no-header-files --compress=zip-9 --output /javaruntime Enable compression of resources zip[0-9]: zip-0: No compression zip-6: Default value zip-9: Best compression
  • 22. The Application Stage Build FROM oraclelinux:8-slim ENV JAVA_HOME /usr/java/openjdk-21 ENV PATH $JAVA_HOME/bin:$PATH COPY --from=jre-build /javaruntime $JAVA_HOME # Continue with your application deployment ENV JDK_JAVA_OPTIONS "--enable-preview" CMD ["/entrypoint.sh"] Copy the custom JRE
  • 23. The Application Stage Build FROM oraclelinux:8-slim ENV JAVA_HOME /usr/java/openjdk-21 ENV PATH $JAVA_HOME/bin:$PATH COPY --from=jre-build /javaruntime $JAVA_HOME # Continue with your application deployment ENV JDK_JAVA_OPTIONS "--enable-preview" CMD ["/entrypoint.sh"] Copy the artifacts needed by your application
  • 24. The Application Stage Build FROM oraclelinux:8-slim ENV JAVA_HOME /usr/java/openjdk-21 ENV PATH $JAVA_HOME/bin:$PATH COPY --from=jre-build /javaruntime $JAVA_HOME # Continue with your application deployment ENV JDK_JAVA_OPTIONS "--enable-preview" CMD ["/entrypoint.sh"] Run the application
  • 25. How about fine tuning JVM Flags?
  • 26. Conserving Dynamic Footprint by Minimizing Java Heap Size Start by looking at the JVM ergonomics
  • 27. Conserving Dynamic Footprint by Minimizing Java Heap Size Start by looking at the JVM ergonomics At initialization of the virtual machine, the entire space for the heap is reserved. Eg: setting for minimum and maximum heap size: -Xms768m -Xmx768m
  • 28. Conserving Dynamic Footprint by Minimizing Java Heap Size Start by looking at the JVM ergonomics At initialization of the virtual machine, the entire space for the heap is reserved. Eg: setting for minimum and maximum heap size: -Xms768m -Xmx768m Minimize Java heap size by lowering the values of the options: • -XX:MaxHeapFreeRatio (default value is 70%) -XX:MinHeapFreeRatio (default value is 40%) • Eg:-XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=70
  • 29. What if the problem is not the amount of resources allocated to/by the JVM?
  • 30. Tracking Native Memory With jcmd FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink --add-modules <modules, jdk.jcmd> --no-man-pages --no-header-files --compress=zip-9 --output /javaruntime Add jdk.jcmd module
  • 31. Tracking Native Memory With jcmd WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM.
  • 32. Tracking Native Memory With jcmd WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM. Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS • kubectl set env deployment/app JDK_JAVA_OPTIONS=“-XX:NativeMemoryTracking=summary” • Please consider that having NMT enabled can add application performance overhead.
  • 33. Tracking Native Memory With jcmd WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM. Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS Create a native memory baseline kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory baseline"
  • 34. Tracking Native Memory With jcmd WARNING: Overusing jcmd to send diagnostic commands can affect the performance of the VM. Add -XX:NativeMemoryTracking={off|summary|detail} to JDK_JAVA_OPTIONS Create a native memory baseline kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory baseline" Create a native memory summary diff kubectl exec pod_name –it --/bin/bash -c "jcmd llvmid VM.native_memory summary.diff"
  • 35. Performance and Resource Consumption Overview information about the Java VM and monitored values. Information about memory use. Information about thread use. Information about class loading. Information about the Java VM. Information about MBeans
  • 37. Obtain Statistics with jstat and jmap Obtain statistics about garbage collectors by running jstat kubectl exec pod_name –it --/bin/bash -c "jstat -gcutil llvmid 500 50"
  • 38. Obtain Statistics with jstat and jmap Obtain statistics about garbage collectors by running jstat kubectl exec pod_name –it --/bin/bash -c "jstat -gcutil llvmid 500 50" Print heap summaries kubectl exec pod_name –it --/bin/bash -c "jmap -histo llvmid"
  • 39. Capture Performance Relevant JVM And Application Events
  • 40. When to Use Profiling “To consume the data today, a user must start a recording, stop it, dump the contents to disk and then parse the recording file. This works well for application profiling, where typically at least a minute of data is being recorded at a time, but not for monitoring purposes.“ source: JEP 349
  • 41. FROM container-registry.oracle.com/java/openjdk:21-oraclelinux8 as jre-build # Create a custom Java runtime RUN $JAVA_HOME/bin/jlink --add-modules <modules, jdk.jfr> --no-man-pages --no-header-files --compress=zip-9 --output /javaruntime Add JFR To Your Container Image Add jdk.jfr module
  • 42. How to Use JFR Enable JFR in JDK_JAVA_OPTIONS kubectl set env deployment/app JDK_JAVA_OPTIONS=“--XX:StartFlightRecording:..” For example, start a time fixed recording with default profile -XX:StartFlightRecording=delay=10s,duration=10m,name=Default,settings=default Use the diagnostic command: kubectl exec pod_name –it --/bin/bash -c "jcmd 1 JFR.start…"
  • 43. Monitor and React ….. AppTarget 1 AppTarget 2 AppTarget n Prometheus server Pull metrics Pull metrics Pull metrics Gathering metrics Visualizing metrics Alerting
  • 44. Streaming selected metrics to your monitoring service Where to Use JFR Streaming
  • 45. Stream selected metrics to your monitoring service Send an average, min, max, etc of a metric Where to Use JFR Streaming
  • 46. Stream selected metrics to your monitoring service Send an average, min, max, etc of a metric Expose JFR data through other management APIs Where to Use JFR Streaming
  • 47. Make your settings by extending jdk.jfr.SettingControl Recording Custom JFR Events
  • 48. Make your settings by extending jdk.jfr.SettingControl Create your custom event by extending jdk.jfr.Event Recording Custom JFR Events
  • 49. Recording Custom JFR Events Make your settings by extending jdk.jfr.SettingControl Create your custom event by extending jdk.jfr.Event Register the custom settings in your custom event via @jdk.jfr.SettingsDefinition
  • 50. Recording Custom Events in Spring Boot (example) Capture the custom JFR events in a dedicated filter and register it
  • 51. Recording Custom Events in Spring Boot (example) Listen the custom JFR events and record their duration
  • 53. Useful Links • Article https://www.javaadvent.com/2022/12/a-sneak-peek-at-the-java-performance-toolbox.html • Tools https://docs.oracle.com/en/java/javase/21/docs/specs/man/index.html • jlink https://dev.java/learn/jlink/ • Troubleshoot Memory Leaks: https://docs.oracle.com/en/java/javase/21/troubleshoot/troubleshooting-memory- leaks.html • Innovative JFR use by @gunnarmorling: https://www.morling.dev/blog/finding-java-thread-leaks-with-jdk-flight- recorder-and-bit-of-sql/ • @gunnarmorling article on custom JDK Flight Recorder Events • Great intro by @BillyKorando https://www.youtube.com/watch?v=K1ApBZGiT-Y • Stack walker episode by @BillyKorando: https://inside.java/2023/05/14/stackwalker-02/