SlideShare a Scribd company logo
1 of 6
Download to read offline
Garbage
Collection in
Java
Ondřej Kratochvíl
▷ Young
Allocation of new objects
Often collected
Minor garbage collection when full - Stop the World event
▷ Old
Stores long surviving objects (also Stop the World)
Major garbage collection
JVM Generations
▷ Permanent (Tenured)
Metadata for JVM
class/method descriptors
Data stored at runtime based on classes in use
Can be collected - when space is needed and JVM does no
longer need some old classes
included in Full garbage collection
JVM Generations
▷ New object is allocated in New generation in eden space
▷ When eden space fills up, minor GC is triggered
Referenced objects are moved to first survivor space, age++
▷ At the next minor GC, referenced objects are moved to
SECOND survivor space
▷ After each minor GC, the spaces switch
▷ If referenced object’s age > threshold, it gets promoted to
Old generation
GC Process - Young generation
▷ Serial GC
Mark-Sweep-Compact algorithm in the old generation
For small memory/small amount of CPU cores
▷ Parallel GC (Throughput GC)
Multithreaded for young generation
▷ Parallel Old GC
Parallel for both generations
▷ CMS GC (Concurrent mark-sweep)
Low pause time
Objects are swept while other are still being marked
GC types
Díky za pozornost!
Otázky?
Ondřej Kratochvíl
ondrej.kratochvil@keyup.eu

More Related Content

Viewers also liked

DevOps DDay - Streamline DevOps Workflows With APIs
DevOps DDay - Streamline DevOps Workflows With APIsDevOps DDay - Streamline DevOps Workflows With APIs
DevOps DDay - Streamline DevOps Workflows With APIsRestlet
 
Protractor tests no processo de integração contínua
Protractor tests no processo de integração contínuaProtractor tests no processo de integração contínua
Protractor tests no processo de integração contínuaWalmyr Lima e Silva Filho
 
pagoPa, i pagamenti elettronici nella Pubblica Amministrazione
pagoPa, i pagamenti elettronici nella Pubblica AmministrazionepagoPa, i pagamenti elettronici nella Pubblica Amministrazione
pagoPa, i pagamenti elettronici nella Pubblica AmministrazioneDaniele Mondello
 
A person I admire
A person I admireA person I admire
A person I admireTimofeyeva
 
Open API Strategy, by Sensedia
Open API Strategy, by SensediaOpen API Strategy, by Sensedia
Open API Strategy, by SensediaSensedia
 
強化学習の汎用化Ai
強化学習の汎用化Ai強化学習の汎用化Ai
強化学習の汎用化AiMasato Nakai
 
Io t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doinIo t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doinJonny Doin
 

Viewers also liked (9)

DevOps DDay - Streamline DevOps Workflows With APIs
DevOps DDay - Streamline DevOps Workflows With APIsDevOps DDay - Streamline DevOps Workflows With APIs
DevOps DDay - Streamline DevOps Workflows With APIs
 
Protractor tests no processo de integração contínua
Protractor tests no processo de integração contínuaProtractor tests no processo de integração contínua
Protractor tests no processo de integração contínua
 
pagoPa, i pagamenti elettronici nella Pubblica Amministrazione
pagoPa, i pagamenti elettronici nella Pubblica AmministrazionepagoPa, i pagamenti elettronici nella Pubblica Amministrazione
pagoPa, i pagamenti elettronici nella Pubblica Amministrazione
 
A person I admire
A person I admireA person I admire
A person I admire
 
Open API Strategy, by Sensedia
Open API Strategy, by SensediaOpen API Strategy, by Sensedia
Open API Strategy, by Sensedia
 
強化学習の汎用化Ai
強化学習の汎用化Ai強化学習の汎用化Ai
強化学習の汎用化Ai
 
A survey in privacy and security in Internet of Things IOT
A survey in privacy and security in Internet of Things IOTA survey in privacy and security in Internet of Things IOT
A survey in privacy and security in Internet of Things IOT
 
Io t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doinIo t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doin
 
Coffee script
Coffee scriptCoffee script
Coffee script
 

Similar to Garbage Collection in Java

Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimizationRajan Jethva
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionHaribabu Nandyal Padmanaban
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Marcos García
 
[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?Alonso Torres
 
The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friendKai Koenig
 
Garbage collection
Garbage collectionGarbage collection
Garbage collectionMudit Gupta
 
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
 
Jvm lecture
Jvm lectureJvm lecture
Jvm lecturesdslnmd
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance TuningJeremy Leisy
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage CollectionHaim Yadid
 
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMjaganmohanreddyk
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в JavaOlga Lavrentieva
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVMaragozin
 
Hotspot Garbage Collection - The Useful Parts
Hotspot Garbage Collection - The Useful PartsHotspot Garbage Collection - The Useful Parts
Hotspot Garbage Collection - The Useful PartsjClarity
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyDhanu Gupta
 
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...jaxLondonConference
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VMYongqiang Li
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVMaragozin
 

Similar to Garbage Collection in Java (20)

Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimization
 
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
 
Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)Quick introduction to Java Garbage Collector (JVM GC)
Quick introduction to Java Garbage Collector (JVM GC)
 
[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?[Jbcn 2016] Garbage Collectors WTF!?
[Jbcn 2016] Garbage Collectors WTF!?
 
Jvm is-your-friend
Jvm is-your-friendJvm is-your-friend
Jvm is-your-friend
 
The JVM is your friend
The JVM is your friendThe JVM is your friend
The JVM is your friend
 
Garbage collection
Garbage collectionGarbage collection
Garbage collection
 
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
 
Jvm lecture
Jvm lectureJvm lecture
Jvm lecture
 
JVM Performance Tuning
JVM Performance TuningJVM Performance Tuning
JVM Performance Tuning
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVM
 
«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java«Большие объёмы данных и сборка мусора в Java
«Большие объёмы данных и сборка мусора в Java
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
 
Hotspot Garbage Collection - The Useful Parts
Hotspot Garbage Collection - The Useful PartsHotspot Garbage Collection - The Useful Parts
Hotspot Garbage Collection - The Useful Parts
 
Java Garbage Collection(GC)- Study
Java Garbage Collection(GC)- StudyJava Garbage Collection(GC)- Study
Java Garbage Collection(GC)- Study
 
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
Garbage Collection: the Useful Parts - Martijn Verburg & Dr John Oliver (jCla...
 
Garbage Collection of Java VM
Garbage Collection of Java VMGarbage Collection of Java VM
Garbage Collection of Java VM
 
Heap & thread dump
Heap & thread dumpHeap & thread dump
Heap & thread dump
 
Garbage collection in JVM
Garbage collection in JVMGarbage collection in JVM
Garbage collection in JVM
 

More from Keyup

Unity
UnityUnity
UnityKeyup
 
Google AdWords a Google AdSense vs. AdBlock.
Google AdWords a Google AdSense vs. AdBlock.Google AdWords a Google AdSense vs. AdBlock.
Google AdWords a Google AdSense vs. AdBlock.Keyup
 
WinJS
WinJSWinJS
WinJSKeyup
 
Redux+React
Redux+ReactRedux+React
Redux+ReactKeyup
 
CSS flexbox
CSS flexboxCSS flexbox
CSS flexboxKeyup
 
Magento 2
Magento 2Magento 2
Magento 2Keyup
 
Silex
SilexSilex
SilexKeyup
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on railsKeyup
 
HHVM & Hack
HHVM & HackHHVM & Hack
HHVM & HackKeyup
 
Icinga2
Icinga2Icinga2
Icinga2Keyup
 
O auth2
O auth2O auth2
O auth2Keyup
 
Úvod do bezpečnosti na webu
Úvod do bezpečnosti na webuÚvod do bezpečnosti na webu
Úvod do bezpečnosti na webuKeyup
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScriptKeyup
 
Easymock
EasymockEasymock
EasymockKeyup
 
CSS 3
CSS 3CSS 3
CSS 3Keyup
 
Contract in Java
Contract in JavaContract in Java
Contract in JavaKeyup
 
Jenkins
JenkinsJenkins
JenkinsKeyup
 
JLint
JLintJLint
JLintKeyup
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook reactKeyup
 
Optimalizace rychlosti stránek
Optimalizace rychlosti stránekOptimalizace rychlosti stránek
Optimalizace rychlosti stránekKeyup
 

More from Keyup (20)

Unity
UnityUnity
Unity
 
Google AdWords a Google AdSense vs. AdBlock.
Google AdWords a Google AdSense vs. AdBlock.Google AdWords a Google AdSense vs. AdBlock.
Google AdWords a Google AdSense vs. AdBlock.
 
WinJS
WinJSWinJS
WinJS
 
Redux+React
Redux+ReactRedux+React
Redux+React
 
CSS flexbox
CSS flexboxCSS flexbox
CSS flexbox
 
Magento 2
Magento 2Magento 2
Magento 2
 
Silex
SilexSilex
Silex
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
HHVM & Hack
HHVM & HackHHVM & Hack
HHVM & Hack
 
Icinga2
Icinga2Icinga2
Icinga2
 
O auth2
O auth2O auth2
O auth2
 
Úvod do bezpečnosti na webu
Úvod do bezpečnosti na webuÚvod do bezpečnosti na webu
Úvod do bezpečnosti na webu
 
CoffeeScript
CoffeeScriptCoffeeScript
CoffeeScript
 
Easymock
EasymockEasymock
Easymock
 
CSS 3
CSS 3CSS 3
CSS 3
 
Contract in Java
Contract in JavaContract in Java
Contract in Java
 
Jenkins
JenkinsJenkins
Jenkins
 
JLint
JLintJLint
JLint
 
Angular js vs. Facebook react
Angular js vs. Facebook reactAngular js vs. Facebook react
Angular js vs. Facebook react
 
Optimalizace rychlosti stránek
Optimalizace rychlosti stránekOptimalizace rychlosti stránek
Optimalizace rychlosti stránek
 

Recently uploaded

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 

Recently uploaded (20)

What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 

Garbage Collection in Java

  • 2. ▷ Young Allocation of new objects Often collected Minor garbage collection when full - Stop the World event ▷ Old Stores long surviving objects (also Stop the World) Major garbage collection JVM Generations
  • 3. ▷ Permanent (Tenured) Metadata for JVM class/method descriptors Data stored at runtime based on classes in use Can be collected - when space is needed and JVM does no longer need some old classes included in Full garbage collection JVM Generations
  • 4. ▷ New object is allocated in New generation in eden space ▷ When eden space fills up, minor GC is triggered Referenced objects are moved to first survivor space, age++ ▷ At the next minor GC, referenced objects are moved to SECOND survivor space ▷ After each minor GC, the spaces switch ▷ If referenced object’s age > threshold, it gets promoted to Old generation GC Process - Young generation
  • 5. ▷ Serial GC Mark-Sweep-Compact algorithm in the old generation For small memory/small amount of CPU cores ▷ Parallel GC (Throughput GC) Multithreaded for young generation ▷ Parallel Old GC Parallel for both generations ▷ CMS GC (Concurrent mark-sweep) Low pause time Objects are swept while other are still being marked GC types
  • 6. Díky za pozornost! Otázky? Ondřej Kratochvíl ondrej.kratochvil@keyup.eu