Java Garbage Collection: 
A Performance Impact 
Dnepropetrovsk 
7 November 2014 
Blynov Viacheslav
7 November 2014 2
3 
Java GC: A Performance Impact Introduction 
Agenda 
 Garbage Collection Overview 
 Java GC Algorithms 
 Basic GC Tuning 
7 November 2014
7 November 2014 4
5 
Java GC: A Performance Impact Garbage Collection Overview 
GC Purpose 
Objects that are referenced are said to be live 
Objects that are no longer referenced are considered dead and termed garbage 
Garbage collector is responsible for: 
 allocating memory 
 ensuring that any referenced objects remain in memory 
 recovering memory used by objects that are no longer reachable from 
references in executing code 
7 November 2014
6 
Java GC: A Performance Impact Garbage Collection Overview 
GC Purpose 
7 November 2014
7 
Java GC: A Performance Impact Garbage Collection Overview 
GC performance impact 
 Collector needs computational resources (CPU cycles) to perform garbage 
collection 
 As garbage collection involves moving objects in memory a collector must 
ensure that no thread is using these objects 
7 November 2014 
The pauses when all application threads are stopped are called 
stop-the-world pauses 
These pauses generally have the greatest impact on the performance of an 
application, and minimizing those pauses is the key consideration when tuning 
GC.
8 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
9 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
10 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
11 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
12 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
13 
Java GC: A Performance Impact Garbage Collection Overview 
Generational model 
7 November 2014
14 
Java GC: A Performance Impact Garbage Collection Overview 
Summary 
 all GC algorithms divide the heap into old and young generation 
 all GC algorithm employ stop-the-world approach to clearing objects from young 
generation, which is usually a very quick operation 
7 November 2014
7 November 2014 15
16 
Java GC: A Performance Impact Java GC Algorithms 
“Client” and “Server” JVM types 
7 November 2014 
Depending on underlying hardware platform and version JVM can act as 
“client” of “server” VM. This affect the choice of JIT compiler and default GC 
algorithm. 
 “client” platform is usually 32-bit and has 1 CPU 
 “server” platform is usually 64-bit (but 32-bit is also possible) and has several 
CPUs
17 
Java GC: A Performance Impact Java GC Algorithms 
GC Algorithms 
 Serial garbage collector (-XX:+UseSerialGC) 
 Throughput collector (-XX:+UseParallelGC , -XX:+UseParallelOldGC) 
 CMS collector (-XX:+UseConcMarkSweepGC, -XX:+UseParNewGC) 
 G1 collector (-XX:+UseG1GC) 
7 November 2014
 default collector for client-class platforms (32-bit JVMs on Windows or single-processor 
18 
Java GC: A Performance Impact Java GC Algorithms 
Serial garbage collector 
7 November 2014 
machines) 
 uses single thread to process heap 
 stops all application threads for both minor and full GC 
Usage cases: 
 no low-pause requirements 
 “client-style” single-CPU environment 
 very small heap (few hundred MBs) 
 several JVMs running on single platform (number of JVM > number of available 
CPUs)
 default collector for server-class machines (multi-CPU Unix machines or any 64- 
 utilizes multiple threads for garbage collection to gain speed and minimize 
 stops all application threads for both minor and full GC 
 -XX:+UseParallelGC enables multi-threaded collection of young generation and 
 -XX:+UseParallelOldGC enables multi-threaded collection of young generation 
19 
Java GC: A Performance Impact Java GC Algorithms 
Throughput (parallel) garbage collector 
bit JVM) 
pauses 
single-threaded old-generation collection/compaction 
and multi-threaded old-generation collection/compaction 
Usage cases: 
 multi-CPU are available 
 large heap size and many object created/discarded 
7 November 2014
 designed to eliminate long pauses associated with full GC cycles 
 stops all application threads during minor GC 
 uses different algorithm to collect young generation (-XX:+UseParNewGC) 
 uses one or more background threads to periodically scan through the old 
 do not perform any compaction 
 in case of CPU unavailability and/or heap fragmentation – fallback to serial 
 low pause requirement and available CPU resources 
 in case of single-CPU machine can be used with -XX:+CMSIncrementalMode 
20 
Java GC: A Performance Impact Java GC Algorithms 
CMS (Concurrent Mark Sweep) collector 
generation and discard unused objects. This makes CMS a low-paused collector 
collector 
 by default does not collect permgen 
Usage cases: 
(deprecated in Java 8) 
7 November 2014
 designed to process large heaps (more than 4 Gb) with minimal pauses 
 divides the heap into separate regions 
 performs incremental compaction of old generation by copying data between 
21 
Java GC: A Performance Impact Java GC Algorithms 
G1 (Garbage First) garbage collector 
regions 
7 November 2014
 Serial GC is best only for application with heap <= 100 Mb 
 Batch jobs which consume all available CPUs will get better performance with 
 Batch jobs which DON’T consume all CPUs could get better performance with 
 When measuring response time the choice between throughput and concurrent 
 Most of the time CMS should overperform G1 for heaps < 4 Gb 
 For large heaps G1 is better because of the way it can divide work between 
22 
Java GC: A Performance Impact Java GC Algorithms 
Summary (choosing GC algorithm) 
concurrent collector 
throughput collector 
collectors depends on CPU availability 
different threads and heap regions 
7 November 2014
7 November 2014 23
 Too small heap -> too much time spent in GC 
 Main rule – never to specify heap more than the amount of available physical 
24 
Java GC: A Performance Impact Basic GC Tuning 
Sizing the heap 
memory 
 -Xms – initial heap size 
 -Xmx – maximum heap size 
7 November 2014
25 
Java GC: A Performance Impact Basic GC Tuning 
Sizing the Generations 
 -XX:NewRatio=N – sets the ration of young generation to old 
 -XX:NewSize=N – sets the size of young generaion 
 -XX:MaxNewSize=N – maximum size for young generation 
7 November 2014
26 
Java GC: A Performance Impact Basic GC Tuning 
Sizing Permgen and Metaspace 
Java 7: 
 -XX:PermSize=N 
 -XX:MaxPermSize=N 
Java 8: 
 -XX:MetaspaceSize=N 
 -XX:MaxMetaspaceSize=N 
7 November 2014
 Adaptive sizing controls how the JVM alters the ratio of young generation to old 
 Adjusting generation sizes is base on GC algorithms attempts to meet their 
 Adaptive tuning can be disabled for small performance boost (usually not 
 Command line argument differs for different GC algorithms. For, example for 
-XX:GCTimeRatio=nnn - hint to the virtual machine that it's desirable that not more 
27 
Java GC: A Performance Impact Basic GC Tuning 
Adaptive Sizing 
JVM can try to find optimal performance according to its policies and configuration 
pause goals 
recommended) 
throughput collector: 
-XX:+UseAdaptiveSizePolicy – whether to use adaptive policy (true by default) 
-XX:MaxGCPauseMillis=nnn – maximal GC pause we can tolerate 
than 1 / (1 + nnn) of the application execution time be spent in the collector 
7 November 2014
Questions? 
7 November 2014 28

More Related Content

PPTX
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
ODP
Java GC, Off-heap workshop
PDF
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
PDF
Dmytro Patkovskyi "Practical tips regarding build optimization for those who ...
PDF
Basics of JVM Tuning
PDF
JVM and Garbage Collection Tuning
PPTX
JVM memory management & Diagnostics
PPT
Performance tuning jvm
Вячеслав Блинов «Java Garbage Collection: A Performance Impact»
Java GC, Off-heap workshop
Choosing Right Garbage Collector to Increase Efficiency of Java Memory Usage
Dmytro Patkovskyi "Practical tips regarding build optimization for those who ...
Basics of JVM Tuning
JVM and Garbage Collection Tuning
JVM memory management & Diagnostics
Performance tuning jvm

What's hot (20)

PDF
Optimizing Application Performance on Kubernetes
PPTX
G1GC
PDF
-XX:+UseG1GC
PPTX
HotSpot JVM Tuning
PDF
On heap cache vs off-heap cache
ODP
Performance Optimization of Rails Applications
PPTX
Building a Better JVM
PDF
Java at Scale, Dallas JUG, October 2013
PDF
Rails Application Optimization Techniques & Tools
PPTX
Progress_190130
PDF
JVM Tuning and Profiling
PPTX
Java Memory Management Tricks
PDF
Evaluation of RBD replication options @CERN
PPT
Jvm Performance Tunning
PPTX
Tuning Java GC to resolve performance issues
PDF
hbaseconasia2017: HBase Practice At XiaoMi
PPT
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
PPTX
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
PDF
GC Tuning Confessions Of A Performance Engineer
PPTX
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Optimizing Application Performance on Kubernetes
G1GC
-XX:+UseG1GC
HotSpot JVM Tuning
On heap cache vs off-heap cache
Performance Optimization of Rails Applications
Building a Better JVM
Java at Scale, Dallas JUG, October 2013
Rails Application Optimization Techniques & Tools
Progress_190130
JVM Tuning and Profiling
Java Memory Management Tricks
Evaluation of RBD replication options @CERN
Jvm Performance Tunning
Tuning Java GC to resolve performance issues
hbaseconasia2017: HBase Practice At XiaoMi
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Garbage First Garbage Collector (G1 GC): Current and Future Adaptability and ...
GC Tuning Confessions Of A Performance Engineer
Garbage First Garbage Collector (G1 GC) - Migration to, Expectations and Adva...
Ad

Viewers also liked (20)

PDF
Java GC - Pause tuning
PDF
[BGOUG] Java GC - Friend or Foe
PDF
Java gc
PPT
Java Garbage Collection(GC)- Study
PPTX
Java concurrency
PDF
Java Memory Model
PPTX
Николай Папирный Тема: "Java memory model для простых смертных"
PDF
Java Memory Model
ODP
Java Memory Consistency Model - concepts and context
PPTX
Java gc and JVM optimization
PDF
What you need to know about GC
ODP
Java memory model
PPTX
The Java Memory Model
PDF
How long can you afford to Stop The World?
PDF
JVM及其调优
PPTX
The Java memory model made easy
PDF
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
PDF
淺談 Java GC 原理、調教和 新發展
PPTX
Java GC
PDF
Let's Learn to Talk to GC Logs in Java 9
Java GC - Pause tuning
[BGOUG] Java GC - Friend or Foe
Java gc
Java Garbage Collection(GC)- Study
Java concurrency
Java Memory Model
Николай Папирный Тема: "Java memory model для простых смертных"
Java Memory Model
Java Memory Consistency Model - concepts and context
Java gc and JVM optimization
What you need to know about GC
Java memory model
The Java Memory Model
How long can you afford to Stop The World?
JVM及其调优
The Java memory model made easy
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
淺談 Java GC 原理、調教和 新發展
Java GC
Let's Learn to Talk to GC Logs in Java 9
Ad

Similar to Вячеслав Блинов «Java Garbage Collection: A Performance Impact» (20)

PDF
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
PDF
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
PDF
[Outdated] Secrets of Performance Tuning Java on Kubernetes
PDF
Secrets of Performance Tuning Java on Kubernetes
PDF
DevoxxUK: Optimizating Application Performance on Kubernetes
PDF
Tuning Java for Big Data
PDF
Java Performance and Using Java Flight Recorder
PPTX
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
PDF
JVM Performance Tuning
PDF
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
PPTX
JavaPerformanceChapter_4
PDF
Software Profiling: Java Performance, Profiling and Flamegraphs
PPT
Taming Java Garbage Collector
PPTX
Jvm problem diagnostics
PPT
Jvm Performance Tunning
PDF
Gridify your Spring application with Grid Gain @ Spring Italian Meeting 2008
PPTX
006 performance tuningandclusteradmin
PDF
TWJUG x Oracle Groundbreakers 2019 Taiwan - What’s New in Last Java Versions
PDF
ZGC-SnowOne.pdf
PDF
Java Performance and Profiling
State of Java Elasticity. Tuning Java Efficiency - GIDS.JAVA LIVE 2020
Elastic JVM for Scalable Java EE Applications Running in Containers #Jakart...
[Outdated] Secrets of Performance Tuning Java on Kubernetes
Secrets of Performance Tuning Java on Kubernetes
DevoxxUK: Optimizating Application Performance on Kubernetes
Tuning Java for Big Data
Java Performance and Using Java Flight Recorder
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
JVM Performance Tuning
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
JavaPerformanceChapter_4
Software Profiling: Java Performance, Profiling and Flamegraphs
Taming Java Garbage Collector
Jvm problem diagnostics
Jvm Performance Tunning
Gridify your Spring application with Grid Gain @ Spring Italian Meeting 2008
006 performance tuningandclusteradmin
TWJUG x Oracle Groundbreakers 2019 Taiwan - What’s New in Last Java Versions
ZGC-SnowOne.pdf
Java Performance and Profiling

More from Anna Shymchenko (20)

PPTX
Константин Маркович: "Creating modular application using Spring Boot "
PPTX
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
PPTX
Евгений Руднев: "Programmers Approach to Error Handling"
PPTX
Александр Куцан: "Static Code Analysis in C++"
PPTX
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
PPTX
Орхан Гасимов: "Reactive Applications in Java with Akka"
PPTX
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
PPTX
Денис Прокопюк: “JMX in Java EE applications”
PDF
Роман Яворский "Introduction to DevOps"
PDF
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
PDF
Андрей Лисниченко "SQL Injection"
PPTX
Светлана Мухина "Metrics on agile projects"
PPTX
Андрей Слободяник "Test driven development using mockito"
PPTX
Евгений Хыст "Application performance database related problems"
PPTX
Даурен Муса “IBM WebSphere - expensive but effective”
PPTX
Александр Пашинский "Reinventing Design Patterns with Java 8"
PPTX
Евгений Капинос "Advanced JPA (Java Persistent API)"
PPTX
Event-driven architecture with Java technology stack
PPTX
Do we need SOLID principles during software development?
PPTX
Guava - Elements of Functional Programming
Константин Маркович: "Creating modular application using Spring Boot "
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Руднев: "Programmers Approach to Error Handling"
Александр Куцан: "Static Code Analysis in C++"
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Орхан Гасимов: "Reactive Applications in Java with Akka"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Денис Прокопюк: “JMX in Java EE applications”
Роман Яворский "Introduction to DevOps"
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Андрей Лисниченко "SQL Injection"
Светлана Мухина "Metrics on agile projects"
Андрей Слободяник "Test driven development using mockito"
Евгений Хыст "Application performance database related problems"
Даурен Муса “IBM WebSphere - expensive but effective”
Александр Пашинский "Reinventing Design Patterns with Java 8"
Евгений Капинос "Advanced JPA (Java Persistent API)"
Event-driven architecture with Java technology stack
Do we need SOLID principles during software development?
Guava - Elements of Functional Programming

Recently uploaded (20)

PDF
How Tridens DevSecOps Ensures Compliance, Security, and Agility
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
E-Commerce Website Development Companyin india
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
Microsoft Office 365 Crack Download Free
PPTX
Full-Stack Developer Courses That Actually Land You Jobs
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PDF
Visual explanation of Dijkstra's Algorithm using Python
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PDF
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
PDF
Autodesk AutoCAD Crack Free Download 2025
PPTX
Trending Python Topics for Data Visualization in 2025
PPTX
Introduction to Windows Operating System
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PPTX
Download Adobe Photoshop Crack 2025 Free
PDF
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
PDF
CCleaner 6.39.11548 Crack 2025 License Key
How Tridens DevSecOps Ensures Compliance, Security, and Agility
Wondershare Recoverit Full Crack New Version (Latest 2025)
E-Commerce Website Development Companyin india
Salesforce Agentforce AI Implementation.pdf
Microsoft Office 365 Crack Download Free
Full-Stack Developer Courses That Actually Land You Jobs
DNT Brochure 2025 – ISV Solutions @ D365
Visual explanation of Dijkstra's Algorithm using Python
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Topaz Photo AI Crack New Download (Latest 2025)
Top 10 Software Development Trends to Watch in 2025 🚀.pdf
Autodesk AutoCAD Crack Free Download 2025
Trending Python Topics for Data Visualization in 2025
Introduction to Windows Operating System
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Download Adobe Photoshop Crack 2025 Free
How AI/LLM recommend to you ? GDG meetup 16 Aug by Fariman Guliev
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
CCleaner 6.39.11548 Crack 2025 License Key

Вячеслав Блинов «Java Garbage Collection: A Performance Impact»

  • 1. Java Garbage Collection: A Performance Impact Dnepropetrovsk 7 November 2014 Blynov Viacheslav
  • 3. 3 Java GC: A Performance Impact Introduction Agenda  Garbage Collection Overview  Java GC Algorithms  Basic GC Tuning 7 November 2014
  • 5. 5 Java GC: A Performance Impact Garbage Collection Overview GC Purpose Objects that are referenced are said to be live Objects that are no longer referenced are considered dead and termed garbage Garbage collector is responsible for:  allocating memory  ensuring that any referenced objects remain in memory  recovering memory used by objects that are no longer reachable from references in executing code 7 November 2014
  • 6. 6 Java GC: A Performance Impact Garbage Collection Overview GC Purpose 7 November 2014
  • 7. 7 Java GC: A Performance Impact Garbage Collection Overview GC performance impact  Collector needs computational resources (CPU cycles) to perform garbage collection  As garbage collection involves moving objects in memory a collector must ensure that no thread is using these objects 7 November 2014 The pauses when all application threads are stopped are called stop-the-world pauses These pauses generally have the greatest impact on the performance of an application, and minimizing those pauses is the key consideration when tuning GC.
  • 8. 8 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 9. 9 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 10. 10 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 11. 11 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 12. 12 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 13. 13 Java GC: A Performance Impact Garbage Collection Overview Generational model 7 November 2014
  • 14. 14 Java GC: A Performance Impact Garbage Collection Overview Summary  all GC algorithms divide the heap into old and young generation  all GC algorithm employ stop-the-world approach to clearing objects from young generation, which is usually a very quick operation 7 November 2014
  • 16. 16 Java GC: A Performance Impact Java GC Algorithms “Client” and “Server” JVM types 7 November 2014 Depending on underlying hardware platform and version JVM can act as “client” of “server” VM. This affect the choice of JIT compiler and default GC algorithm.  “client” platform is usually 32-bit and has 1 CPU  “server” platform is usually 64-bit (but 32-bit is also possible) and has several CPUs
  • 17. 17 Java GC: A Performance Impact Java GC Algorithms GC Algorithms  Serial garbage collector (-XX:+UseSerialGC)  Throughput collector (-XX:+UseParallelGC , -XX:+UseParallelOldGC)  CMS collector (-XX:+UseConcMarkSweepGC, -XX:+UseParNewGC)  G1 collector (-XX:+UseG1GC) 7 November 2014
  • 18.  default collector for client-class platforms (32-bit JVMs on Windows or single-processor 18 Java GC: A Performance Impact Java GC Algorithms Serial garbage collector 7 November 2014 machines)  uses single thread to process heap  stops all application threads for both minor and full GC Usage cases:  no low-pause requirements  “client-style” single-CPU environment  very small heap (few hundred MBs)  several JVMs running on single platform (number of JVM > number of available CPUs)
  • 19.  default collector for server-class machines (multi-CPU Unix machines or any 64-  utilizes multiple threads for garbage collection to gain speed and minimize  stops all application threads for both minor and full GC  -XX:+UseParallelGC enables multi-threaded collection of young generation and  -XX:+UseParallelOldGC enables multi-threaded collection of young generation 19 Java GC: A Performance Impact Java GC Algorithms Throughput (parallel) garbage collector bit JVM) pauses single-threaded old-generation collection/compaction and multi-threaded old-generation collection/compaction Usage cases:  multi-CPU are available  large heap size and many object created/discarded 7 November 2014
  • 20.  designed to eliminate long pauses associated with full GC cycles  stops all application threads during minor GC  uses different algorithm to collect young generation (-XX:+UseParNewGC)  uses one or more background threads to periodically scan through the old  do not perform any compaction  in case of CPU unavailability and/or heap fragmentation – fallback to serial  low pause requirement and available CPU resources  in case of single-CPU machine can be used with -XX:+CMSIncrementalMode 20 Java GC: A Performance Impact Java GC Algorithms CMS (Concurrent Mark Sweep) collector generation and discard unused objects. This makes CMS a low-paused collector collector  by default does not collect permgen Usage cases: (deprecated in Java 8) 7 November 2014
  • 21.  designed to process large heaps (more than 4 Gb) with minimal pauses  divides the heap into separate regions  performs incremental compaction of old generation by copying data between 21 Java GC: A Performance Impact Java GC Algorithms G1 (Garbage First) garbage collector regions 7 November 2014
  • 22.  Serial GC is best only for application with heap <= 100 Mb  Batch jobs which consume all available CPUs will get better performance with  Batch jobs which DON’T consume all CPUs could get better performance with  When measuring response time the choice between throughput and concurrent  Most of the time CMS should overperform G1 for heaps < 4 Gb  For large heaps G1 is better because of the way it can divide work between 22 Java GC: A Performance Impact Java GC Algorithms Summary (choosing GC algorithm) concurrent collector throughput collector collectors depends on CPU availability different threads and heap regions 7 November 2014
  • 24.  Too small heap -> too much time spent in GC  Main rule – never to specify heap more than the amount of available physical 24 Java GC: A Performance Impact Basic GC Tuning Sizing the heap memory  -Xms – initial heap size  -Xmx – maximum heap size 7 November 2014
  • 25. 25 Java GC: A Performance Impact Basic GC Tuning Sizing the Generations  -XX:NewRatio=N – sets the ration of young generation to old  -XX:NewSize=N – sets the size of young generaion  -XX:MaxNewSize=N – maximum size for young generation 7 November 2014
  • 26. 26 Java GC: A Performance Impact Basic GC Tuning Sizing Permgen and Metaspace Java 7:  -XX:PermSize=N  -XX:MaxPermSize=N Java 8:  -XX:MetaspaceSize=N  -XX:MaxMetaspaceSize=N 7 November 2014
  • 27.  Adaptive sizing controls how the JVM alters the ratio of young generation to old  Adjusting generation sizes is base on GC algorithms attempts to meet their  Adaptive tuning can be disabled for small performance boost (usually not  Command line argument differs for different GC algorithms. For, example for -XX:GCTimeRatio=nnn - hint to the virtual machine that it's desirable that not more 27 Java GC: A Performance Impact Basic GC Tuning Adaptive Sizing JVM can try to find optimal performance according to its policies and configuration pause goals recommended) throughput collector: -XX:+UseAdaptiveSizePolicy – whether to use adaptive policy (true by default) -XX:MaxGCPauseMillis=nnn – maximal GC pause we can tolerate than 1 / (1 + nnn) of the application execution time be spent in the collector 7 November 2014