SlideShare a Scribd company logo
1 of 43
HotSpot JVM Tuning By: Gilad Garon Technical Meeting!
-Xmx2g It’s more than just: What is JVM Tuning? It’s a combination of: ,[object Object]
Software architectureBut most of all, JVM Tuning is about: Understanding how your application works!
The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
Swing desktop client application Wicket web application Mobile web application (In development) Multiple AS:JBoss Clusters, Apache Cluster, Tomcat & Terracotta Multiple frameworks: Spring, Guice, Wicket, Hibernate, Terracotta DSO, XStream, EJB 3.0, JMS, CGLib & Proprietary frameworks    Technical Information The IDI Test Case
The IDI Test Case
3000 +/- EJB Invocations per minute 100+ concurrent web sessions Internal Print servers clients  Internal Mail servers clients Internal Webservices clients JBoss EAR cluster user load information The IDI Test Case
The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
How many software engineers does it take to change a light bulb? Hardware choices affects code performance Hardware choices affects OS offerings (Do you really want Windows?) Hardware isn’t easily replaced, it costs a lot. Choosing the right hardware None. It's a hardware problem.
Which CPU architecture is right for you? Higher clock speed? (what about Moore’s law?) Higher core count? Number of hardware threads? Choosing the right hardware Remember: ,[object Object]
Highly computational apps relay on clock speed
Highly concurrent / multi user app relay on number of threads
Hardware benchmarking helps a lot, but it’s difficult to arrange,[object Object]
IDI Hardware history Choosing the right hardware @ IDI
The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
Remember this? Garbage Collectors Garbage Collection means that don’t have to anymore
When the JVM starts, the host OS assigns a dedicated memory space to that VM The VM allocates memory to the application within that dedicated memory space The VM frees memory automatically via garbage collectors Garbage Collection is an expensive algorithm JVM Memory Handling Garbage Collectors
The memory space is divided into three separated memory spaces: Eden SpaceWhere objects are born Survivor SpacesWhere objects mature Tenure SpaceWhere objects grow old and die Generational Memory Space Garbage Collectors
HotSpot  VM‘s Generational Memory Space Garbage Collectors Eden Space Survivor Space 2 Survivor Space 1 Tenure (Old) Generation Permanent Generation
ConcurrencyConcurrency describes its ability to do work while application threads are still running ParallelismParallelismdescribes the collector's ability to perform its work across multiple threads of execution. Hence, a collector can be parallel but not concurrent, concurrent but not parallel, or both parallel and concurrent. Technical Terms: Garbage Collectors
Copy CollectorA collector that copies live object from one space to another Low Pause CollectorA collector that works along side the application threads Throughput CollectorA collector that doesn’t add to the serial execution time of the application Technical Terms: Garbage Collectors
Memory FragmentationThe amount of unusable free memory (small holes that object can’t be fitted in) Stop the world:The application threads are stopped during the garbage collection Minor CollectionA garbage collection of the young generation Major CollectionA garbage collection of the old generation Technical Terms, Continued: Garbage Collectors
Types of GC Strategies (Generational): Garbage Collectors
Garbage Collectors “Parallel New” Strategy ,[object Object]
Old generation collection is done in serial“Parallel” Strategy ,[object Object]
Old generation collection is done in serial“Parallel Old” Strategy Young generation collection is done in parallel Old generation collection is done mostly in parallel
Low pause collector (short Stop the World pauses) Uses Parallel New for new generation GC Uses CMS for old generation GC Non compacting old generation collector Starts before the memory space is full (68%) Requires a larger heap Concurrent Mark-Sweep Strategy Garbage Collectors
Serial Collector (New Generation Space) Garbage Collectors
Serial GC Strategy - Young Generation Garbage Collectors No more room! Promoting to Tenure space Eden memory space Garbage Collection! Resuming Application Survived!Earned it’s place inTenure space Survivor space (To) Survivor space (From) Tenure memory space
Serial Collector (Old Generation Space) Garbage Collectors
Concurrent Mark-Sweep Garbage Collectors
CMS - Old Generation Garbage Collectors Tenure memory space Garbage Collection! Resuming Application Stop The World! Phase: Initial Mark Concurrent Mark Remark Concurrent Sweep Concurrent Pre-Clean
High probability soft real time collector One memory space for the young and tenure generation Entire memory space is divided into equally sized cards Cards are managed by regions and tracked by “Remembered Sets” for changes A global card table track all the cards Garbage First (G1) What’s the big deal? Garbage Collectors
Garbage First (G1) - Heap Structure Garbage Collectors Card (512 Bytes) Region A Card (512 Bytes) Region B Global Card Table Card (512 Bytes) Region N Remembered Set (Per Region)
Garbage First - Minor Collection Garbage Collectors Similar to Parallel New Compacts young regions  Also compacts old regions if there’s time Garbage First - Major Collection ,[object Object]
Marks low lived ratio regions for collection in the minor collection phase,[object Object]
IDI Garbage Collection Strategy: Garbage Collectors @ IDI
The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
This is JVM Tuning: JVM Tuning
-Xmx<size><units> -Xms<size><units> -d64 -server -XX:MaxPermSize=<size><units> -XX:-HeapDumpOnOutOfMemoryError The must know flags JVM Tuning
-Xloggc:<file_name> -XX:+ PrintHeapAtGC -XX:+ PrintGCDateStamps -XX:+ PrintGCDetails -XX:+ PrintGCApplicationStoppedTime -XX:+ PrintGCApplicationConcurrentTime GC Logs JVM Tuning
-XX:+ UseSerialGC -XX:+ UseParNewGC -XX:+UseConcMarkSweepGC  -XX:+ UseParallelGC -XX:+UseParallelOldGC -XX:+UseG1GC (JDK 1.7) -XX:+UnlockExperimentalVMOptions(for G1 JDK 1.6_14)     Garbage Collector Strategies JVM Tuning
Tuning GC JVM Tuning

More Related Content

What's hot

Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesSergey Podolsky
 
An Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAn Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAbhishek Asthana
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big DataScott Seighman
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageJelastic Multi-Cloud PaaS
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011Kris Mok
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展Leon Chen
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOMLeon Chen
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and youKai Koenig
 
On heap cache vs off-heap cache
On heap cache vs off-heap cacheOn heap cache vs off-heap cache
On heap cache vs off-heap cachergrebski
 
(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag SessionJens Hadlich
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra MetricsChris Lohfink
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage CollectionDoug Hawkins
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionHaribabu Nandyal Padmanaban
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerMonica Beckwith
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...Jelastic Multi-Cloud PaaS
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVMaragozin
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Monica Beckwith
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationMonica Beckwith
 

What's hot (20)

How long can you afford to Stop The World?
How long can you afford to Stop The World?How long can you afford to Stop The World?
How long can you afford to Stop The World?
 
Tuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issuesTuning Java GC to resolve performance issues
Tuning Java GC to resolve performance issues
 
An Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in JavaAn Introduction to JVM Internals and Garbage Collection in Java
An Introduction to JVM Internals and Garbage Collection in Java
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
 
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory UsageChoosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
 
JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011JVM @ Taobao - QCon Hangzhou 2011
JVM @ Taobao - QCon Hangzhou 2011
 
Java GC, Off-heap workshop
Java GC, Off-heap workshopJava GC, Off-heap workshop
Java GC, Off-heap workshop
 
淺談 Java GC 原理、調教和 新發展
淺談 Java GC 原理、調教和新發展淺談 Java GC 原理、調教和新發展
淺談 Java GC 原理、調教和 新發展
 
Fight with Metaspace OOM
Fight with Metaspace OOMFight with Metaspace OOM
Fight with Metaspace OOM
 
Garbage First and you
Garbage First and youGarbage First and you
Garbage First and you
 
On heap cache vs off-heap cache
On heap cache vs off-heap cacheOn heap cache vs off-heap cache
On heap cache vs off-heap cache
 
(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session(JVM) Garbage Collection - Brown Bag Session
(JVM) Garbage Collection - Brown Bag Session
 
Storing Cassandra Metrics
Storing Cassandra MetricsStoring Cassandra Metrics
Storing Cassandra Metrics
 
Understanding Garbage Collection
Understanding Garbage CollectionUnderstanding Garbage Collection
Understanding Garbage Collection
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
 
GC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance EngineerGC Tuning Confessions Of A Performance Engineer
GC Tuning Confessions Of A Performance Engineer
 
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...Elastic JVM  for Scalable Java EE Applications  Running in Containers #Jakart...
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
 
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
 
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time CompilationThe Performance Engineer's Guide To HotSpot Just-in-Time Compilation
The Performance Engineer's Guide To HotSpot Just-in-Time Compilation
 

Viewers also liked

Java Performance Monitoring & Tuning
Java Performance Monitoring & TuningJava Performance Monitoring & Tuning
Java Performance Monitoring & TuningMuhammed Shakir
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsPhillip Koza
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVMaragozin
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGTomek Borek
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage CollectionAzul Systems Inc.
 
Tune up Yarn and Hive
Tune up Yarn and HiveTune up Yarn and Hive
Tune up Yarn and Hiverxu
 
Java Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and TuningJava Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and TuningCarol McDonald
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance TunningTerry Cho
 
JVM Tuning and Profiling
JVM Tuning and ProfilingJVM Tuning and Profiling
JVM Tuning and ProfilingBhuvan Rawal
 

Viewers also liked (11)

Java Performance Monitoring & Tuning
Java Performance Monitoring & TuningJava Performance Monitoring & Tuning
Java Performance Monitoring & Tuning
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applications
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUG
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
Tune up Yarn and Hive
Tune up Yarn and HiveTune up Yarn and Hive
Tune up Yarn and Hive
 
Java Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and TuningJava Garbage Collection, Monitoring, and Tuning
Java Garbage Collection, Monitoring, and Tuning
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Hive tuning
Hive tuningHive tuning
Hive tuning
 
JVM Tuning and Profiling
JVM Tuning and ProfilingJVM Tuning and Profiling
JVM Tuning and Profiling
 
AI and the Future of Growth
AI and the Future of GrowthAI and the Future of Growth
AI and the Future of Growth
 

Similar to HotSpot JVM Tuning

Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010yaevents
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnosticsDanijel Mitar
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersSanjoy Kumar Roy
 
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12sidg75
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Yonik Seeley
 
Java 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesJava 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesHaim Yadid
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!devObjective
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020Jelastic Multi-Cloud PaaS
 
Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Yossi Elkrief
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxTier1 app
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Anna Shymchenko
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance TuningJeremy Leisy
 
Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machineelliando dias
 
Debugging Native heap OOM - JavaOne 2013
Debugging Native heap OOM - JavaOne 2013Debugging Native heap OOM - JavaOne 2013
Debugging Native heap OOM - JavaOne 2013MattKilner
 

Similar to HotSpot JVM Tuning (20)

JVM Magic
JVM MagicJVM Magic
JVM Magic
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Azul yandexjune010
Azul yandexjune010Azul yandexjune010
Azul yandexjune010
 
Taming The JVM
Taming The JVMTaming The JVM
Taming The JVM
 
Jvm problem diagnostics
Jvm problem diagnosticsJvm problem diagnostics
Jvm problem diagnostics
 
An introduction to G1 collector for busy developers
An introduction to G1 collector for busy developersAn introduction to G1 collector for busy developers
An introduction to G1 collector for busy developers
 
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
 
Java 8 Launch - MetaSpaces
Java 8 Launch - MetaSpacesJava 8 Launch - MetaSpaces
Java 8 Launch - MetaSpaces
 
Garbage First & You
Garbage First & YouGarbage First & You
Garbage First & You
 
Garbage First and You!
Garbage First and You!Garbage First and You!
Garbage First and You!
 
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
 
Android Memory , Where is all My RAM
Android Memory , Where is all My RAM Android Memory , Where is all My RAM
Android Memory , Where is all My RAM
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 
this-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptxthis-is-garbage-talk-2022.pptx
this-is-garbage-talk-2022.pptx
 
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
Inside The Java Virtual Machine
Inside The Java Virtual MachineInside The Java Virtual Machine
Inside The Java Virtual Machine
 
Debugging Native heap OOM - JavaOne 2013
Debugging Native heap OOM - JavaOne 2013Debugging Native heap OOM - JavaOne 2013
Debugging Native heap OOM - JavaOne 2013
 

Recently uploaded

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

HotSpot JVM Tuning

  • 1. HotSpot JVM Tuning By: Gilad Garon Technical Meeting!
  • 2.
  • 3. Software architectureBut most of all, JVM Tuning is about: Understanding how your application works!
  • 4. The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
  • 5. Swing desktop client application Wicket web application Mobile web application (In development) Multiple AS:JBoss Clusters, Apache Cluster, Tomcat & Terracotta Multiple frameworks: Spring, Guice, Wicket, Hibernate, Terracotta DSO, XStream, EJB 3.0, JMS, CGLib & Proprietary frameworks Technical Information The IDI Test Case
  • 7. 3000 +/- EJB Invocations per minute 100+ concurrent web sessions Internal Print servers clients Internal Mail servers clients Internal Webservices clients JBoss EAR cluster user load information The IDI Test Case
  • 8. The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
  • 9. How many software engineers does it take to change a light bulb? Hardware choices affects code performance Hardware choices affects OS offerings (Do you really want Windows?) Hardware isn’t easily replaced, it costs a lot. Choosing the right hardware None. It's a hardware problem.
  • 10.
  • 11. Highly computational apps relay on clock speed
  • 12. Highly concurrent / multi user app relay on number of threads
  • 13.
  • 14. IDI Hardware history Choosing the right hardware @ IDI
  • 15. The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
  • 16. Remember this? Garbage Collectors Garbage Collection means that don’t have to anymore
  • 17. When the JVM starts, the host OS assigns a dedicated memory space to that VM The VM allocates memory to the application within that dedicated memory space The VM frees memory automatically via garbage collectors Garbage Collection is an expensive algorithm JVM Memory Handling Garbage Collectors
  • 18. The memory space is divided into three separated memory spaces: Eden SpaceWhere objects are born Survivor SpacesWhere objects mature Tenure SpaceWhere objects grow old and die Generational Memory Space Garbage Collectors
  • 19. HotSpot VM‘s Generational Memory Space Garbage Collectors Eden Space Survivor Space 2 Survivor Space 1 Tenure (Old) Generation Permanent Generation
  • 20. ConcurrencyConcurrency describes its ability to do work while application threads are still running ParallelismParallelismdescribes the collector's ability to perform its work across multiple threads of execution. Hence, a collector can be parallel but not concurrent, concurrent but not parallel, or both parallel and concurrent. Technical Terms: Garbage Collectors
  • 21. Copy CollectorA collector that copies live object from one space to another Low Pause CollectorA collector that works along side the application threads Throughput CollectorA collector that doesn’t add to the serial execution time of the application Technical Terms: Garbage Collectors
  • 22. Memory FragmentationThe amount of unusable free memory (small holes that object can’t be fitted in) Stop the world:The application threads are stopped during the garbage collection Minor CollectionA garbage collection of the young generation Major CollectionA garbage collection of the old generation Technical Terms, Continued: Garbage Collectors
  • 23. Types of GC Strategies (Generational): Garbage Collectors
  • 24.
  • 25.
  • 26. Old generation collection is done in serial“Parallel Old” Strategy Young generation collection is done in parallel Old generation collection is done mostly in parallel
  • 27. Low pause collector (short Stop the World pauses) Uses Parallel New for new generation GC Uses CMS for old generation GC Non compacting old generation collector Starts before the memory space is full (68%) Requires a larger heap Concurrent Mark-Sweep Strategy Garbage Collectors
  • 28. Serial Collector (New Generation Space) Garbage Collectors
  • 29. Serial GC Strategy - Young Generation Garbage Collectors No more room! Promoting to Tenure space Eden memory space Garbage Collection! Resuming Application Survived!Earned it’s place inTenure space Survivor space (To) Survivor space (From) Tenure memory space
  • 30. Serial Collector (Old Generation Space) Garbage Collectors
  • 32. CMS - Old Generation Garbage Collectors Tenure memory space Garbage Collection! Resuming Application Stop The World! Phase: Initial Mark Concurrent Mark Remark Concurrent Sweep Concurrent Pre-Clean
  • 33. High probability soft real time collector One memory space for the young and tenure generation Entire memory space is divided into equally sized cards Cards are managed by regions and tracked by “Remembered Sets” for changes A global card table track all the cards Garbage First (G1) What’s the big deal? Garbage Collectors
  • 34. Garbage First (G1) - Heap Structure Garbage Collectors Card (512 Bytes) Region A Card (512 Bytes) Region B Global Card Table Card (512 Bytes) Region N Remembered Set (Per Region)
  • 35.
  • 36.
  • 37. IDI Garbage Collection Strategy: Garbage Collectors @ IDI
  • 38. The IDI Test Case Choosing the right hardware Garbage Collectors JVM Tuning Agenda JVM Tuning
  • 39. This is JVM Tuning: JVM Tuning
  • 40. -Xmx<size><units> -Xms<size><units> -d64 -server -XX:MaxPermSize=<size><units> -XX:-HeapDumpOnOutOfMemoryError The must know flags JVM Tuning
  • 41. -Xloggc:<file_name> -XX:+ PrintHeapAtGC -XX:+ PrintGCDateStamps -XX:+ PrintGCDetails -XX:+ PrintGCApplicationStoppedTime -XX:+ PrintGCApplicationConcurrentTime GC Logs JVM Tuning
  • 42. -XX:+ UseSerialGC -XX:+ UseParNewGC -XX:+UseConcMarkSweepGC  -XX:+ UseParallelGC -XX:+UseParallelOldGC -XX:+UseG1GC (JDK 1.7) -XX:+UnlockExperimentalVMOptions(for G1 JDK 1.6_14)     Garbage Collector Strategies JVM Tuning
  • 43. Tuning GC JVM Tuning
  • 44. Tuning GC JVM Tuning
  • 45. Tuning GC JVM Tuning
  • 46. Tuning GC JVM Tuning And many many more…
  • 47. Java SE 6 HotSpot[tm] Virtual Machine Garbage Collection Tuning Memory Management Whitepaper Garbage-First Garbage Collection Whitepaper Setting Java GC Parameters For Large Heaps Java Tuning White Paper Java HotSpot VM Options The most complete list of -XX options for Java 6 JVM G1: Java's Garbage First Garbage Collector` References
  • 48. The Garbage-First Garbage Collector (JavaOne 2008) JVM Internals - Garbage Collection & Runtime Optimizations Garbage Collection in the Java HotSpot Virtual Machine References