SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 

Kürzlich hochgeladen (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
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
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
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
 
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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 

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