SlideShare a Scribd company logo
1 of 26
Java 7 Garbage Collector G1
Antons Kranga, 3rd May 2012
Introduction to GC
What is GC?




Garbage Collector – reclaims unreachable
removes objects that you don’t need
anymore




Copyright © 2012 Accenture All rights reserved.   Picture is the © of Disney   3
How does it works?

•   Java Code                                     •   Heap




Copyright © 2012 Accenture All rights reserved.              4
How does it works?

•   Java Code                                     •   Heap

             Object x = new Object();


                                                                 x
                                                             # of ref= 1




Copyright © 2012 Accenture All rights reserved.                            5
How does it works?

•   Java Code                                     •   Heap

             Object x = new Object();
             Object y = new Object();
                                                                 x
                                                             # of ref= 1
                                                                               y
                                                                           # of ref= 1




Copyright © 2012 Accenture All rights reserved.                                          6
How does it works?

•   Java Code                                     •   Heap

             Object x = new Object();
             Object y = new Object();
             y = x;                                              x
                                                             # of ref= 2
                                                                               y
                                                                           # of ref= 0




Copyright © 2012 Accenture All rights reserved.                                          7
How does it works?

•   Java Code                                     •   Heap

             Object x = new Object();
             Object y = new Object();
             y = x;                                              x
                                                             # of ref= 2
                                                                               y
                                                                           # of ref= 0



                                                         object y can
                                                         be collected




Copyright © 2012 Accenture All rights reserved.                                          8
How does it works?

•   Java Code                                     •   Heap

             Object x = new Object();
             Object y = new Object();
             y = x;                                              x
             List z = new ArrayList();
                                                             # of ref= 3
             z.add(x);                                                         y
                                                                           # of ref= 0
                                                                 z
                                                             # of ref= 1




Copyright © 2012 Accenture All rights reserved.                                          9
How does it works?

•   Java Code                                     •   Heap
    {
             Object x = new Object();
             Object y = new Object();
             y = x;                                              x
             List z = new ArrayList();
                                                             # of ref= 3
             z.add(x);                                                         y
    }
                                                                           # of ref= 0
                                                                 z
                                                             # of ref= 1




Copyright © 2012 Accenture All rights reserved.                                          10
How does it works?

•   Java Code                                                      •    Heap
    {
             Object x = new Object();
             Object y = new Object();
             y = x;                                                                x
             List z = new ArrayList();
                                                                               # of ref= 3
             z.add(x);                                                                           y
    }
                                                                                             # of ref= 0
                                                                                   z
                                                                               # of ref= 1
                                                       objects in
                                                  island of isolation
                                                    can be collected




Copyright © 2012 Accenture All rights reserved.                                                            11
What you need to know about GC



•   Garbage Collector is non deterministic


•   GC carried by separate daemon threat


•   Stop the World – pauses all threats during GC




Copyright © 2012 Accenture All rights reserved.     12
Generational GCs
Generational GC

•   Generations are of new or survived during GC objects




Copyright © 2012 Accenture All rights reserved.   Picture taken from OpenFreak.com   14
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects




                                       eden       survivor   tenured


Copyright © 2012 Accenture All rights reserved.                        Picture taken from OpenFreak.com   15
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects
                        Objects
                     experienced no
                       GC (age 0)




                                       eden       survivor   tenured


Copyright © 2012 Accenture All rights reserved.                        Picture taken from OpenFreak.com   16
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects
                                                  experiences several GCs
                                                    (2 spaces by default)




                                       eden             survivor            tenured


Copyright © 2012 Accenture All rights reserved.                                       Picture taken from OpenFreak.com   17
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects
                                                               Objects survived
                                                                multiple GCs




                                       eden       survivor   tenured


Copyright © 2012 Accenture All rights reserved.                               Picture taken from OpenFreak.com   18
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects
                                        young generation     tenured generation




                                       eden       survivor     tenured


Copyright © 2012 Accenture All rights reserved.                               Picture taken from OpenFreak.com   19
Generational GC

•   Generations are of new or survived during GC objects


•   Heap divided in zones by age of the objects
                                        young generation     tenured generation




      objects                                                                                     objects
    collected by                                                                                 collected
     Minor and                                                                                    only by
      Full GC                                                                                    Full GC

                                       eden       survivor    tenured


Copyright © 2012 Accenture All rights reserved.                               Picture taken from OpenFreak.com   20
Objects survival rate statistics




Copyright © 2012 Accenture All rights reserved.   21
Types of generational GC in Java




•   Serial Collector – always stop-the-world




Copyright © 2012 Accenture All rights reserved.   22
Types of generational GC in Java




•   Throughput Collector
    –   Concurrent for minor GC
    –   Stop-the-world for major GC




Copyright © 2012 Accenture All rights reserved.   23
Types of generational GC in Java



•   Concurrent Low Pause Collector –
    –   Tenured gen: application paused for short periods during
        GC
    –   Young gen: runs concurrently
    –   the app. will have a large number of long-lived objects,
        and there is a pause time constraint




Copyright © 2012 Accenture All rights reserved.                    24
GC Metrics

Primary Parameters
1.       Throughput
     –   percentage of the total run time not spent performing GC
2.       Pauses
     –   times when the application code stops running while GC is
         performed
     –   number of pauses, their average duration and their maximum
         duration

Secondary Parameters:
1.       Footprint
     –   current heap size (amount of memory) being used
2.       Promptness
     –   how quickly memory from objects no longer needed is freed

Copyright © 2012 Accenture All rights reserved.                       25
To be continued

More Related Content

What's hot

Functions and Objects in JavaScript
Functions and Objects in JavaScript Functions and Objects in JavaScript
Functions and Objects in JavaScript Dhananjay Kumar
 
Pattern Matching in Java - Srikanth Sankaran
Pattern Matching in Java - Srikanth SankaranPattern Matching in Java - Srikanth Sankaran
Pattern Matching in Java - Srikanth SankaranEclipse Day India
 
Declarative Name Binding and Scope Rules
Declarative Name Binding and Scope RulesDeclarative Name Binding and Scope Rules
Declarative Name Binding and Scope RulesEelco Visser
 
Scala Domain Modeling and Architecture
Scala Domain Modeling and ArchitectureScala Domain Modeling and Architecture
Scala Domain Modeling and ArchitectureHossam Karim
 
M Gumbel - SCABIO: a framework for bioinformatics algorithms in Scala
M Gumbel - SCABIO: a framework for bioinformatics algorithms in ScalaM Gumbel - SCABIO: a framework for bioinformatics algorithms in Scala
M Gumbel - SCABIO: a framework for bioinformatics algorithms in ScalaJan Aerts
 
London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09bwhitcher
 
Learning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisLearning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisAndreas Dewes
 

What's hot (14)

Functions and Objects in JavaScript
Functions and Objects in JavaScript Functions and Objects in JavaScript
Functions and Objects in JavaScript
 
Pattern Matching in Java - Srikanth Sankaran
Pattern Matching in Java - Srikanth SankaranPattern Matching in Java - Srikanth Sankaran
Pattern Matching in Java - Srikanth Sankaran
 
Declarative Name Binding and Scope Rules
Declarative Name Binding and Scope RulesDeclarative Name Binding and Scope Rules
Declarative Name Binding and Scope Rules
 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scala
 
Scala Domain Modeling and Architecture
Scala Domain Modeling and ArchitectureScala Domain Modeling and Architecture
Scala Domain Modeling and Architecture
 
Scala vs java 8
Scala vs java 8Scala vs java 8
Scala vs java 8
 
Basic data structures part I
Basic data structures part IBasic data structures part I
Basic data structures part I
 
unsplitted slideshare
unsplitted slideshareunsplitted slideshare
unsplitted slideshare
 
M Gumbel - SCABIO: a framework for bioinformatics algorithms in Scala
M Gumbel - SCABIO: a framework for bioinformatics algorithms in ScalaM Gumbel - SCABIO: a framework for bioinformatics algorithms in Scala
M Gumbel - SCABIO: a framework for bioinformatics algorithms in Scala
 
06slide
06slide06slide
06slide
 
London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09London useR Meeting 21-Jul-09
London useR Meeting 21-Jul-09
 
Lecture7 data structure(tree)
Lecture7 data structure(tree)Lecture7 data structure(tree)
Lecture7 data structure(tree)
 
Learning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysisLearning from other's mistakes: Data-driven code analysis
Learning from other's mistakes: Data-driven code analysis
 
03slide
03slide03slide
03slide
 

Viewers also liked

Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorJava Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorGurpreet Sachdeva
 
Hadoop world g1_gc_forh_base_v4
Hadoop world g1_gc_forh_base_v4Hadoop world g1_gc_forh_base_v4
Hadoop world g1_gc_forh_base_v4YanpingWang
 
Moving to g1 gc by Kirk Pepperdine.
Moving to g1 gc by Kirk Pepperdine.Moving to g1 gc by Kirk Pepperdine.
Moving to g1 gc by Kirk Pepperdine.J On The Beach
 
How to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleHow to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleCapgemini
 
Jvm基础调优实践(v1.0)
Jvm基础调优实践(v1.0)Jvm基础调优实践(v1.0)
Jvm基础调优实践(v1.0)ddviplinux
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?C2B2 Consulting
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big DataScott Seighman
 
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
 
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 ControlLeon Chen
 
Solving Multi-tenancy and G1GC in Apache HBase
Solving Multi-tenancy and G1GC in Apache HBase Solving Multi-tenancy and G1GC in Apache HBase
Solving Multi-tenancy and G1GC in Apache HBase HBaseCon
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Monica Beckwith
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningSimone Bordet
 

Viewers also liked (14)

Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) CollectorJava Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
Java Garbage Collectors – Moving to Java7 Garbage First (G1) Collector
 
Hadoop world g1_gc_forh_base_v4
Hadoop world g1_gc_forh_base_v4Hadoop world g1_gc_forh_base_v4
Hadoop world g1_gc_forh_base_v4
 
Moving to G1GC
Moving to G1GCMoving to G1GC
Moving to G1GC
 
Moving to g1 gc by Kirk Pepperdine.
Moving to g1 gc by Kirk Pepperdine.Moving to g1 gc by Kirk Pepperdine.
Moving to g1 gc by Kirk Pepperdine.
 
How to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning BattleHow to Become a Winner in the JVM Performance-Tuning Battle
How to Become a Winner in the JVM Performance-Tuning Battle
 
Jvm基础调优实践(v1.0)
Jvm基础调优实践(v1.0)Jvm基础调优实践(v1.0)
Jvm基础调优实践(v1.0)
 
G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?G1 Garbage Collector - Big Heaps and Low Pauses?
G1 Garbage Collector - Big Heaps and Low Pauses?
 
Tuning Java for Big Data
Tuning Java for Big DataTuning Java for Big Data
Tuning Java for Big Data
 
JVM及其调优
JVM及其调优JVM及其调优
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...
 
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
 
Solving Multi-tenancy and G1GC in Apache HBase
Solving Multi-tenancy and G1GC in Apache HBase Solving Multi-tenancy and G1GC in Apache HBase
Solving Multi-tenancy and G1GC in Apache HBase
 
Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!Garbage First Garbage Collector: Where the Rubber Meets the Road!
Garbage First Garbage Collector: Where the Rubber Meets the Road!
 
G1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and TuningG1 Garbage Collector: Details and Tuning
G1 Garbage Collector: Details and Tuning
 

More from Dmitry Buzdin

How Payment Cards Really Work?
How Payment Cards Really Work?How Payment Cards Really Work?
How Payment Cards Really Work?Dmitry Buzdin
 
Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?Dmitry Buzdin
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?Dmitry Buzdin
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?Dmitry Buzdin
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDmitry Buzdin
 
Big Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop InfrastructureBig Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop InfrastructureDmitry Buzdin
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIsDmitry Buzdin
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахDmitry Buzdin
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fmDmitry Buzdin
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIDmitry Buzdin
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsDmitry Buzdin
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional ProgrammingDmitry Buzdin
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contestDmitry Buzdin
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery Dmitry Buzdin
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOpsDmitry Buzdin
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump AnalysisDmitry Buzdin
 

More from Dmitry Buzdin (20)

How Payment Cards Really Work?
How Payment Cards Really Work?How Payment Cards Really Work?
How Payment Cards Really Work?
 
Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?Как построить свой фреймворк для автотестов?
Как построить свой фреймворк для автотестов?
 
How to grow your own Microservice?
How to grow your own Microservice?How to grow your own Microservice?
How to grow your own Microservice?
 
How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?How to Build Your Own Test Automation Framework?
How to Build Your Own Test Automation Framework?
 
Delivery Pipeline for Windows Machines
Delivery Pipeline for Windows MachinesDelivery Pipeline for Windows Machines
Delivery Pipeline for Windows Machines
 
Big Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop InfrastructureBig Data Processing Using Hadoop Infrastructure
Big Data Processing Using Hadoop Infrastructure
 
JOOQ and Flyway
JOOQ and FlywayJOOQ and Flyway
JOOQ and Flyway
 
Developing Useful APIs
Developing Useful APIsDeveloping Useful APIs
Developing Useful APIs
 
Whats New in Java 8
Whats New in Java 8Whats New in Java 8
Whats New in Java 8
 
Архитектура Ленты на Одноклассниках
Архитектура Ленты на ОдноклассникахАрхитектура Ленты на Одноклассниках
Архитектура Ленты на Одноклассниках
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Riding Redis @ask.fm
Riding Redis @ask.fmRiding Redis @ask.fm
Riding Redis @ask.fm
 
Rubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part IIRubylight JUG Contest Results Part II
Rubylight JUG Contest Results Part II
 
Rubylight Pattern-Matching Solutions
Rubylight Pattern-Matching SolutionsRubylight Pattern-Matching Solutions
Rubylight Pattern-Matching Solutions
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Poor Man's Functional Programming
Poor Man's Functional ProgrammingPoor Man's Functional Programming
Poor Man's Functional Programming
 
Rubylight programming contest
Rubylight programming contestRubylight programming contest
Rubylight programming contest
 
Continuous Delivery
Continuous Delivery Continuous Delivery
Continuous Delivery
 
Introduction to DevOps
Introduction to DevOpsIntroduction to DevOps
Introduction to DevOps
 
Thread Dump Analysis
Thread Dump AnalysisThread Dump Analysis
Thread Dump Analysis
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 

Java7 Garbage Collector G1

  • 1. Java 7 Garbage Collector G1 Antons Kranga, 3rd May 2012
  • 3. What is GC? Garbage Collector – reclaims unreachable removes objects that you don’t need anymore Copyright © 2012 Accenture All rights reserved. Picture is the © of Disney 3
  • 4. How does it works? • Java Code • Heap Copyright © 2012 Accenture All rights reserved. 4
  • 5. How does it works? • Java Code • Heap Object x = new Object(); x # of ref= 1 Copyright © 2012 Accenture All rights reserved. 5
  • 6. How does it works? • Java Code • Heap Object x = new Object(); Object y = new Object(); x # of ref= 1 y # of ref= 1 Copyright © 2012 Accenture All rights reserved. 6
  • 7. How does it works? • Java Code • Heap Object x = new Object(); Object y = new Object(); y = x; x # of ref= 2 y # of ref= 0 Copyright © 2012 Accenture All rights reserved. 7
  • 8. How does it works? • Java Code • Heap Object x = new Object(); Object y = new Object(); y = x; x # of ref= 2 y # of ref= 0 object y can be collected Copyright © 2012 Accenture All rights reserved. 8
  • 9. How does it works? • Java Code • Heap Object x = new Object(); Object y = new Object(); y = x; x List z = new ArrayList(); # of ref= 3 z.add(x); y # of ref= 0 z # of ref= 1 Copyright © 2012 Accenture All rights reserved. 9
  • 10. How does it works? • Java Code • Heap { Object x = new Object(); Object y = new Object(); y = x; x List z = new ArrayList(); # of ref= 3 z.add(x); y } # of ref= 0 z # of ref= 1 Copyright © 2012 Accenture All rights reserved. 10
  • 11. How does it works? • Java Code • Heap { Object x = new Object(); Object y = new Object(); y = x; x List z = new ArrayList(); # of ref= 3 z.add(x); y } # of ref= 0 z # of ref= 1 objects in island of isolation can be collected Copyright © 2012 Accenture All rights reserved. 11
  • 12. What you need to know about GC • Garbage Collector is non deterministic • GC carried by separate daemon threat • Stop the World – pauses all threats during GC Copyright © 2012 Accenture All rights reserved. 12
  • 14. Generational GC • Generations are of new or survived during GC objects Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 14
  • 15. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 15
  • 16. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects Objects experienced no GC (age 0) eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 16
  • 17. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects experiences several GCs (2 spaces by default) eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 17
  • 18. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects Objects survived multiple GCs eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 18
  • 19. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects young generation tenured generation eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 19
  • 20. Generational GC • Generations are of new or survived during GC objects • Heap divided in zones by age of the objects young generation tenured generation objects objects collected by collected Minor and only by Full GC Full GC eden survivor tenured Copyright © 2012 Accenture All rights reserved. Picture taken from OpenFreak.com 20
  • 21. Objects survival rate statistics Copyright © 2012 Accenture All rights reserved. 21
  • 22. Types of generational GC in Java • Serial Collector – always stop-the-world Copyright © 2012 Accenture All rights reserved. 22
  • 23. Types of generational GC in Java • Throughput Collector – Concurrent for minor GC – Stop-the-world for major GC Copyright © 2012 Accenture All rights reserved. 23
  • 24. Types of generational GC in Java • Concurrent Low Pause Collector – – Tenured gen: application paused for short periods during GC – Young gen: runs concurrently – the app. will have a large number of long-lived objects, and there is a pause time constraint Copyright © 2012 Accenture All rights reserved. 24
  • 25. GC Metrics Primary Parameters 1. Throughput – percentage of the total run time not spent performing GC 2. Pauses – times when the application code stops running while GC is performed – number of pauses, their average duration and their maximum duration Secondary Parameters: 1. Footprint – current heap size (amount of memory) being used 2. Promptness – how quickly memory from objects no longer needed is freed Copyright © 2012 Accenture All rights reserved. 25