ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Java GC Study Garbage Collection Dhanu Gupta
Java GC Java objects are eligible for garbage collection (GC), which frees their memory and possibly associated resources, when they are no longer reachable Two stages of GC for an object finalization - runs finalize method on the object reclamation - reclaims memory used by the object
GC Process Basic steps object is determined to be unreachable if object has a finalize method object is added to a finalization queue at some point it¡¯s finalize method is invoked so the object can free associated resources object memory is reclaimed Issues with finalize methods makes every GC pass do more work if a finalize method runs for a long time, it can delay execution of finalize methods of other objects may create new strong references to objects that had none,preventing their GC run in a nondeterministic order no guarantee they will be called; app. may exit first
Generational GC All of the GC algorithms used by Java are variations on the concept of generational GC ?  Generational GC assumes that the most recently created objects are the ones that are most likely to become unreachable soon for example, objects created in a method and only referenced by local variables that go out of scope when the method exits the longer an object remains reachable,the less likely it is to be eligible for GC soon (or ever) Objects are divided into ¡°generations¡± or ¡°spaces¡± Java categories these with the names ¡° young¡±, ¡°tenured¡± and ¡°perm¡± objects can move from one space to another during a GC
Object Spaces Hold objects of similar ages or generations ¡° young¡± spaces hold recently created objects and can be GC¡¯ed in a ¡°minor¡± or ¡°major¡± collection ¡° tenured¡± space hold objects that have survived some number of minor collections and can be GC¡¯ed only in a major collection ¡° perm¡± space hold objects needed by the JVM, such as Class & Method objects, their byte code, and interned Strings GC of this space results in classes being ¡°unloaded¡± Size of each space determined by current heap size(which can change during runtime) and several tuning options
Young Spaces Eden space holds objects created after the last GC,except those that belong in the perm space during a minor collection, these objects are either GC¡¯ed or moved to a survivor space Survivor spaces these spaces hold young objects that have survived at least one GC during a minor collection, these objects are either GC¡¯ed or moved to the other survivor space Minor collections tend to be fast compared to major collections because only a subset of the objects need to be examined typically occur much more frequently than major collections
When Does GC Occurs? Impacted by heap size ¡° If a heap size is small, collection will be fast but the heap will fill up more quickly,thus requiring more frequent collections.¡± ¡° Conversely, a large heap will take longer to fill up and thus collections will be less frequent,but they take longer.¡± Minor collections occur when a young space approaches being full Major collections occur when the tenured space approaches being full
Tools to see Heap Jconsole Memory Analyzer
Thanks Next I will shed More light on GC Properties.

More Related Content

Viewers also liked (20)

Java concurrency
Java concurrencyJava concurrency
Java concurrency
Scheidt & Bachmann
?
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
?ukasz Koniecki
?
Java Memory Model
Java Memory ModelJava Memory Model
Java Memory Model
Skills Matter
?
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
Ciklum Minsk
?
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and context
Tomek Borek
?
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimization
Rajan Jethva
?
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
Kelum Senanayake
?
Java memory model
Java memory modelJava memory model
Java memory model
Micha? Warecki
?
The Java Memory Model
The Java Memory ModelThe Java Memory Model
The Java Memory Model
CA Technologies
?
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?
Java Usergroup Berlin-Brandenburg
?
´³³Õ²Ñ¼°Æäµ÷ÓÅ
´³³Õ²Ñ¼°Æäµ÷ÓÅ´³³Õ²Ñ¼°Æäµ÷ÓÅ
´³³Õ²Ñ¼°Æäµ÷ÓÅ
zhongbing liu
?
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
Sergey Podolsky
?
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
Rafael Winterhalter
?
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
Ludovic Poitou
?
Java GC
Java GCJava GC
Java GC
Ray Cheng
?
Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9
Poonam Bajaj Parhar
?
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
Haim Yadid
?
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
?
Threads and Java Memory Model Explained
Threads and Java Memory Model ExplainedThreads and Java Memory Model Explained
Threads and Java Memory Model Explained
Luiz Fernando Teston
?
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
Monica Beckwith
?
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
§¯§Ú§Ü§à§Ý§Ñ§Û §±§Ñ§á§Ú§â§ß§í§Û §´§Ö§Þ§Ñ: "Java memory model §Õ§Ý§ñ §á§â§à§ã§ä§í§ç §ã§Þ§Ö§â§ä§ß§í§ç"
Ciklum Minsk
?
Java Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and contextJava Memory Consistency Model - concepts and context
Java Memory Consistency Model - concepts and context
Tomek Borek
?
Java gc and JVM optimization
Java gc  and JVM optimizationJava gc  and JVM optimization
Java gc and JVM optimization
Rajan Jethva
?
What you need to know about GC
What you need to know about GCWhat you need to know about GC
What you need to know about GC
Kelum Senanayake
?
´³³Õ²Ñ¼°Æäµ÷ÓÅ
´³³Õ²Ñ¼°Æäµ÷ÓÅ´³³Õ²Ñ¼°Æäµ÷ÓÅ
´³³Õ²Ñ¼°Æäµ÷ÓÅ
zhongbing liu
?
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
Sergey Podolsky
?
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 PresentationGC Tuning in the HotSpot Java VM - a FISL 10 Presentation
GC Tuning in the HotSpot Java VM - a FISL 10 Presentation
Ludovic Poitou
?
Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9Let's Learn to Talk to GC Logs in Java 9
Let's Learn to Talk to GC Logs in Java 9
Poonam Bajaj Parhar
?
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
Haim Yadid
?
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
?
Threads and Java Memory Model Explained
Threads and Java Memory Model ExplainedThreads and Java Memory Model Explained
Threads and Java Memory Model Explained
Luiz Fernando Teston
?
Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!Java 9: The (G1) GC Awakens!
Java 9: The (G1) GC Awakens!
Monica Beckwith
?

Similar to Java Garbage Collection(GC)- Study (16)

Java Garbage Collection
Java Garbage CollectionJava Garbage Collection
Java Garbage Collection
Vinay H G
?
A novel design of a parallel machine learnt
A novel design of a parallel machine learntA novel design of a parallel machine learnt
A novel design of a parallel machine learnt
cseij
?
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
cseij
?
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
Haribabu Nandyal Padmanaban
?
Java Garbage Collector and The Memory Model
Java Garbage Collector and The Memory ModelJava Garbage Collector and The Memory Model
Java Garbage Collector and The Memory Model
Ernesto Arroyo Ron
?
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Mudit Gupta
?
Garbage Collection in Java
Garbage Collection in JavaGarbage Collection in Java
Garbage Collection in Java
Keyup
?
Java Garbage Collection - How it works
Java Garbage Collection - How it worksJava Garbage Collection - How it works
Java Garbage Collection - How it works
Mindfire Solutions
?
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVM
jaganmohanreddyk
?
Javasession10
Javasession10Javasession10
Javasession10
Rajeev Kumar
?
Why using finalizers is a bad idea
Why using finalizers is a bad ideaWhy using finalizers is a bad idea
Why using finalizers is a bad idea
PVS-Studio
?
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crash
Atharva Bhingarkar
?
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crash
Ajit Bhingarkar
?
Garbage collection in C#,important topic
Garbage collection in C#,important topicGarbage collection in C#,important topic
Garbage collection in C#,important topic
ksks28058
?
Java garbage collection & GC friendly coding
Java garbage collection  & GC friendly codingJava garbage collection  & GC friendly coding
Java garbage collection & GC friendly coding
Md Ayub Ali Sarker
?
Garbage collection
Garbage collectionGarbage collection
Garbage collection
Somya Bagai
?
Java Garbage Collection
Java Garbage CollectionJava Garbage Collection
Java Garbage Collection
Vinay H G
?
A novel design of a parallel machine learnt
A novel design of a parallel machine learntA novel design of a parallel machine learnt
A novel design of a parallel machine learnt
cseij
?
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
A Novel Design of a Parallel Machine Learnt Generational Garbage Collector
cseij
?
Performance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage CollectionPerformance Tuning - Understanding Garbage Collection
Performance Tuning - Understanding Garbage Collection
Haribabu Nandyal Padmanaban
?
Java Garbage Collector and The Memory Model
Java Garbage Collector and The Memory ModelJava Garbage Collector and The Memory Model
Java Garbage Collector and The Memory Model
Ernesto Arroyo Ron
?
Garbage Collection in Java
Garbage Collection in JavaGarbage Collection in Java
Garbage Collection in Java
Keyup
?
Java Garbage Collection - How it works
Java Garbage Collection - How it worksJava Garbage Collection - How it works
Java Garbage Collection - How it works
Mindfire Solutions
?
Garbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVMGarbage Collection in Hotspot JVM
Garbage Collection in Hotspot JVM
jaganmohanreddyk
?
Why using finalizers is a bad idea
Why using finalizers is a bad ideaWhy using finalizers is a bad idea
Why using finalizers is a bad idea
PVS-Studio
?
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crash
Atharva Bhingarkar
?
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crash
Ajit Bhingarkar
?
Garbage collection in C#,important topic
Garbage collection in C#,important topicGarbage collection in C#,important topic
Garbage collection in C#,important topic
ksks28058
?
Java garbage collection & GC friendly coding
Java garbage collection  & GC friendly codingJava garbage collection  & GC friendly coding
Java garbage collection & GC friendly coding
Md Ayub Ali Sarker
?

Recently uploaded (20)

Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly MeetupBeyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
GDG Kathmandu
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
?
Columbia Weather Systems - Product Overview
Columbia Weather Systems - Product OverviewColumbia Weather Systems - Product Overview
Columbia Weather Systems - Product Overview
Columbia Weather Systems
?
Migrating to the Isolated worker process in Azure Functions .pptx
Migrating to the Isolated worker process in Azure Functions .pptxMigrating to the Isolated worker process in Azure Functions .pptx
Migrating to the Isolated worker process in Azure Functions .pptx
Callon Campbell
?
Commit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with KubescapeCommit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with Kubescape
Alfredo Garc¨ªa Lavilla
?
Top Tips to Get Your Data AI-Ready? ? ?? ?
Top Tips to Get Your Data AI-Ready? ? ?? ?Top Tips to Get Your Data AI-Ready? ? ?? ?
Top Tips to Get Your Data AI-Ready? ? ?? ?
Precisely
?
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
?
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
?
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsMastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
?
Meet CrewAI The Framework Powering Agentic AI (2).pdf
Meet CrewAI The Framework Powering Agentic AI (2).pdfMeet CrewAI The Framework Powering Agentic AI (2).pdf
Meet CrewAI The Framework Powering Agentic AI (2).pdf
Yodaplus Technologies Private Limited
?
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness
?
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥ÈDragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
CRI Japan, Inc.
?
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryDataNew from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
BookNet Canada
?
AI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting HiringAI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting Hiring
Beyond Chiefs
?
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
?
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio WebUiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
DianaGray10
?
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
?
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptxHHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HampshireHUG
?
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly MeetupBeyond the life of a CISO -  Head of Trust at GDG Kathmandu Monthly Meetup
Beyond the life of a CISO - Head of Trust at GDG Kathmandu Monthly Meetup
GDG Kathmandu
?
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
?
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
?
Migrating to the Isolated worker process in Azure Functions .pptx
Migrating to the Isolated worker process in Azure Functions .pptxMigrating to the Isolated worker process in Azure Functions .pptx
Migrating to the Isolated worker process in Azure Functions .pptx
Callon Campbell
?
Top Tips to Get Your Data AI-Ready? ? ?? ?
Top Tips to Get Your Data AI-Ready? ? ?? ?Top Tips to Get Your Data AI-Ready? ? ?? ?
Top Tips to Get Your Data AI-Ready? ? ?? ?
Precisely
?
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
?
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
?
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
?
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable WorkflowsMastering Azure Durable Functions - Building Resilient and Scalable Workflows
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
?
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness
?
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥ÈDragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN  NB-IoT  LTE cat.M1ÉÌÆ·¥ê¥¹¥È
Dragino¥×¥í¥À¥¯¥È¥«¥¿¥í¥° LoRaWAN NB-IoT LTE cat.M1ÉÌÆ·¥ê¥¹¥È
CRI Japan, Inc.
?
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryDataNew from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
New from BookNet Canada for 2025: BNC SalesData and BNC LibraryData
BookNet Canada
?
AI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting HiringAI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting Hiring
Beyond Chiefs
?
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
?
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio WebUiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
DianaGray10
?
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
?
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptxHHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HHUG-04-2025-Close-more-deals-from-your-existing-pipeline-FOR SLIDESHARE.pptx
HampshireHUG
?

Java Garbage Collection(GC)- Study

  • 1. Java GC Study Garbage Collection Dhanu Gupta
  • 2. Java GC Java objects are eligible for garbage collection (GC), which frees their memory and possibly associated resources, when they are no longer reachable Two stages of GC for an object finalization - runs finalize method on the object reclamation - reclaims memory used by the object
  • 3. GC Process Basic steps object is determined to be unreachable if object has a finalize method object is added to a finalization queue at some point it¡¯s finalize method is invoked so the object can free associated resources object memory is reclaimed Issues with finalize methods makes every GC pass do more work if a finalize method runs for a long time, it can delay execution of finalize methods of other objects may create new strong references to objects that had none,preventing their GC run in a nondeterministic order no guarantee they will be called; app. may exit first
  • 4. Generational GC All of the GC algorithms used by Java are variations on the concept of generational GC ? Generational GC assumes that the most recently created objects are the ones that are most likely to become unreachable soon for example, objects created in a method and only referenced by local variables that go out of scope when the method exits the longer an object remains reachable,the less likely it is to be eligible for GC soon (or ever) Objects are divided into ¡°generations¡± or ¡°spaces¡± Java categories these with the names ¡° young¡±, ¡°tenured¡± and ¡°perm¡± objects can move from one space to another during a GC
  • 5. Object Spaces Hold objects of similar ages or generations ¡° young¡± spaces hold recently created objects and can be GC¡¯ed in a ¡°minor¡± or ¡°major¡± collection ¡° tenured¡± space hold objects that have survived some number of minor collections and can be GC¡¯ed only in a major collection ¡° perm¡± space hold objects needed by the JVM, such as Class & Method objects, their byte code, and interned Strings GC of this space results in classes being ¡°unloaded¡± Size of each space determined by current heap size(which can change during runtime) and several tuning options
  • 6. Young Spaces Eden space holds objects created after the last GC,except those that belong in the perm space during a minor collection, these objects are either GC¡¯ed or moved to a survivor space Survivor spaces these spaces hold young objects that have survived at least one GC during a minor collection, these objects are either GC¡¯ed or moved to the other survivor space Minor collections tend to be fast compared to major collections because only a subset of the objects need to be examined typically occur much more frequently than major collections
  • 7. When Does GC Occurs? Impacted by heap size ¡° If a heap size is small, collection will be fast but the heap will fill up more quickly,thus requiring more frequent collections.¡± ¡° Conversely, a large heap will take longer to fill up and thus collections will be less frequent,but they take longer.¡± Minor collections occur when a young space approaches being full Major collections occur when the tenured space approaches being full
  • 8. Tools to see Heap Jconsole Memory Analyzer
  • 9. Thanks Next I will shed More light on GC Properties.