SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
Eclipse Memory Analyzer
Krasimir Semerdzhiev
Development Architect / SAP Labs Bulgaria
Agenda


Getting started
Get hands dirty
Q&A




© 2011 SAP AG. All rights reserved.   2
Getting started
Few assumptions


You’ve passed beyond “Hello World” in Java
Hello World apps tend not to require too much memory




You’ve gotten an OutOfMemoryError at least once in your life :)




You’re proficient already with Garbage Collection
Attended the previous BGOUG event GC session




© 2011 SAP AG. All rights reserved.                               3
Getting started
Memory analyzer basics


Works with heap dumps – live snapshots of:




© 2011 SAP AG. All rights reserved.          4
Getting started
How to get a heap dump


Non-Interactive
-XX:+HeapDumpOnOutOfMemoryError


On Demand
JDK1.4.2_12+ and -XX:+HeapDumpOnCtrlBreak
JDK6 and JConsole or VisualVM


On IBM VMs
     -Xdump:system:events=throw,filter=java/lang/OutOfMemoryError,
    request=exclusive+prepwalk


More…
http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump




© 2011 SAP AG. All rights reserved.                                    5
Getting started
Shallow vs. Retained heap


Shallow heap is the memory consumed by one object
Retained set of X is the set of objects that will be garbage collected if X is garbage
collected
Retained heap of X is the sum of shallow sizes of all objects in the retained set of
X, i.e. memory kept alive by X

                                       Set of elements    Retained Set
                                       C                  C, F, G, J
                                       K                  K
                                       C, K               C, F, G, J, K, I




© 2011 SAP AG. All rights reserved.                                                  6
Getting started
Dominator tree


An object x dominates an object y if every path in the object graph from the start (or the root)
 node to y must go through x.

In the dominator tree each object is the immediate dominator of its children, so
  dependencies between the objects are easily identified.




© 2011 SAP AG. All rights reserved.                                                           7
Getting started
Dominator tree




© 2011 SAP AG. All rights reserved.   8
Getting started
Java references – java.lang.ref
                                                                         Softly reachable


    Created                           Initialized   Strongly reachable                         Finalized

                                                                         Weakly reachable


Soft reference
                                                                                            Phantom reachable
GC will try to preserve the object
Will collect it prior to throwing OutOfMemoryError



Weak reference
GC is free to reclaim the object.


Phantom reference
Track object collections


© 2011 SAP AG. All rights reserved.                                                                             9
Getting started
GC roots in Java


Keeps the objects in heap from being collected by GC

    System Class                       Finalizer Queue    GC handle      Unknown

    JNI Local                           Unfinalized      Thread stack   Unreachable

   JNI Global                   Thread block    Thread   Busy Monitor




© 2011 SAP AG. All rights reserved.                                                   10
Getting started
What is a leak?




© 2011 SAP AG. All rights reserved.   11
Agenda


Getting started
Get hands dirty
Q&A




© 2011 SAP AG. All rights reserved.   12
Analyze memory consumption
Getting the heap dump: Setup


JConsole refuses to connect




© 2011 SAP AG. All rights reserved.   13
Analyze memory consumption



DEMO




© 2011 SAP AG. All rights reserved.   14
How to get involved?


Eclipse Home Page
        http://www.eclipse.org/mat/

Forum
                 eclipse.technology.memory-analyzer

Blog
                 http://dev.eclipse.org/blogs/memoryanalyzer




© 2011 SAP AG. All rights reserved.                            15
Questions?



Krasimir Semerdzhiev
krasimir.semerdzhiev@sap.com
Thank You!



Krasimir Semerdzhiev
krasimir.semerdzhiev@sap.com

Más contenido relacionado

Similar a [BGOUG] Memory analyzer

JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesKris Mok
 
A path to modularity with Eclipse Virgo
A path to modularity with Eclipse VirgoA path to modularity with Eclipse Virgo
A path to modularity with Eclipse Virgokatya_todorova
 
In The Future We All Use Symfony2
In The Future We All Use Symfony2In The Future We All Use Symfony2
In The Future We All Use Symfony2Brent Shaffer
 
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory AnalyzerThe Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory AnalyzerVladimir Pavlov
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and VirgoHristo Iliev
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |ShubhamAthawane
 
Java 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureJava 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureSander Mak (@Sander_Mak)
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedSteve Dalton
 
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir SemerdzhievOSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhievmfrancis
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjectsMarcel Mitran
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?Charlie Gracie
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?Charlie Gracie
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
 
A quick view about Java Virtual Machine
A quick view about Java Virtual MachineA quick view about Java Virtual Machine
A quick view about Java Virtual MachineJoão Santana
 
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Chicago Hadoop Users Group
 
The Forces Driving Java
The Forces Driving JavaThe Forces Driving Java
The Forces Driving JavaSteve Elliott
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationFredrik Öhrström
 

Similar a [BGOUG] Memory analyzer (20)

JVM: A Platform for Multiple Languages
JVM: A Platform for Multiple LanguagesJVM: A Platform for Multiple Languages
JVM: A Platform for Multiple Languages
 
A path to modularity with Eclipse Virgo
A path to modularity with Eclipse VirgoA path to modularity with Eclipse Virgo
A path to modularity with Eclipse Virgo
 
In The Future We All Use Symfony2
In The Future We All Use Symfony2In The Future We All Use Symfony2
In The Future We All Use Symfony2
 
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory AnalyzerThe Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer
The Right Pill for JRuby Memory and Thread Issues: Eclipse Memory Analyzer
 
Gemini WEB and Virgo
Gemini WEB and VirgoGemini WEB and Virgo
Gemini WEB and Virgo
 
Java notes | All Basics |
Java notes | All Basics |Java notes | All Basics |
Java notes | All Basics |
 
Java 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the futureJava 7: Fork/Join, Invokedynamic and the future
Java 7: Fork/Join, Invokedynamic and the future
 
Java: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggeratedJava: Rumours of my demise are greatly exaggerated
Java: Rumours of my demise are greatly exaggerated
 
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir SemerdzhievOSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
OSGi in Java EE Servers - Sneak Peek Under the Hood - Krasimir Semerdzhiev
 
IBM Java PackedObjects
IBM Java PackedObjectsIBM Java PackedObjects
IBM Java PackedObjects
 
JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?JavaOne2015-What's in an Object?
JavaOne2015-What's in an Object?
 
#JavaOne What's in an object?
#JavaOne What's in an object?#JavaOne What's in an object?
#JavaOne What's in an object?
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applications
 
1 .java basic
1 .java basic1 .java basic
1 .java basic
 
55j7
55j755j7
55j7
 
JavaYDL18
JavaYDL18JavaYDL18
JavaYDL18
 
A quick view about Java Virtual Machine
A quick view about Java Virtual MachineA quick view about Java Virtual Machine
A quick view about Java Virtual Machine
 
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416
 
The Forces Driving Java
The Forces Driving JavaThe Forces Driving Java
The Forces Driving Java
 
Building Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integrationBuilding Large Java Projects Faster: Multicore javac and Makefile integration
Building Large Java Projects Faster: Multicore javac and Makefile integration
 

Más de SAP HANA Cloud Platform

SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP HANA Cloud Platform
 
Gardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsGardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsSAP HANA Cloud Platform
 
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.SAP HANA Cloud Platform
 
Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software SAP HANA Cloud Platform
 
Kubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceKubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceSAP HANA Cloud Platform
 
Options for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersOptions for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersSAP HANA Cloud Platform
 
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP HANA Cloud Platform
 
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP HANA Cloud Platform
 
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP HANA Cloud Platform
 
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP HANA Cloud Platform
 
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform
 
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back  SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back SAP HANA Cloud Platform
 

Más de SAP HANA Cloud Platform (14)

SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtimeSAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
SAP Hack2Build hackathon - SAP Commerce Cloud & Kyma runtime
 
Gardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your TermsGardener: Managed Kubernetes on Your Terms
Gardener: Managed Kubernetes on Your Terms
 
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
Kyma: Extending Business systems with Kubernetes, Istio and <fill the blank>.
 
Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software Using Kubernetes to Extend Enterprise Software
Using Kubernetes to Extend Enterprise Software
 
Kubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceKubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experience
 
Options for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providersOptions for running Kubernetes at scale across multiple cloud providers
Options for running Kubernetes at scale across multiple cloud providers
 
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions IntroSAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
SAP DKOM 2016 | 30154 | SAP HCP Cloud Extensions Intro
 
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
SAP TechEd 2015 | DEV109 | Extending Cloud Solutions from SAP using SAP HANA ...
 
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
SAP D-Code/TechEd 2014|DEV203|Extending SuccessFactors using SAP HANA Cloud P...
 
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
SAP TechEd 2013: CD105: Extending SuccessFactors EmployeeCentral with apps on...
 
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013SAP HANA Cloud Platform Community BOF @ Devoxx 2013
SAP HANA Cloud Platform Community BOF @ Devoxx 2013
 
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back  SAP HANA Cloud: From Your Datacenter to the Cloud and Back
SAP HANA Cloud: From Your Datacenter to the Cloud and Back
 
[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe[BGOUG] Java GC - Friend or Foe
[BGOUG] Java GC - Friend or Foe
 
Eclipse Open Source @ SAP
Eclipse Open Source @ SAPEclipse Open Source @ SAP
Eclipse Open Source @ SAP
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
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
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 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
 

[BGOUG] Memory analyzer

  • 1. Eclipse Memory Analyzer Krasimir Semerdzhiev Development Architect / SAP Labs Bulgaria
  • 2. Agenda Getting started Get hands dirty Q&A © 2011 SAP AG. All rights reserved. 2
  • 3. Getting started Few assumptions You’ve passed beyond “Hello World” in Java Hello World apps tend not to require too much memory You’ve gotten an OutOfMemoryError at least once in your life :) You’re proficient already with Garbage Collection Attended the previous BGOUG event GC session © 2011 SAP AG. All rights reserved. 3
  • 4. Getting started Memory analyzer basics Works with heap dumps – live snapshots of: © 2011 SAP AG. All rights reserved. 4
  • 5. Getting started How to get a heap dump Non-Interactive -XX:+HeapDumpOnOutOfMemoryError On Demand JDK1.4.2_12+ and -XX:+HeapDumpOnCtrlBreak JDK6 and JConsole or VisualVM On IBM VMs -Xdump:system:events=throw,filter=java/lang/OutOfMemoryError, request=exclusive+prepwalk More… http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump © 2011 SAP AG. All rights reserved. 5
  • 6. Getting started Shallow vs. Retained heap Shallow heap is the memory consumed by one object Retained set of X is the set of objects that will be garbage collected if X is garbage collected Retained heap of X is the sum of shallow sizes of all objects in the retained set of X, i.e. memory kept alive by X Set of elements Retained Set C C, F, G, J K K C, K C, F, G, J, K, I © 2011 SAP AG. All rights reserved. 6
  • 7. Getting started Dominator tree An object x dominates an object y if every path in the object graph from the start (or the root) node to y must go through x. In the dominator tree each object is the immediate dominator of its children, so dependencies between the objects are easily identified. © 2011 SAP AG. All rights reserved. 7
  • 8. Getting started Dominator tree © 2011 SAP AG. All rights reserved. 8
  • 9. Getting started Java references – java.lang.ref Softly reachable Created Initialized Strongly reachable Finalized Weakly reachable Soft reference Phantom reachable GC will try to preserve the object Will collect it prior to throwing OutOfMemoryError Weak reference GC is free to reclaim the object. Phantom reference Track object collections © 2011 SAP AG. All rights reserved. 9
  • 10. Getting started GC roots in Java Keeps the objects in heap from being collected by GC System Class Finalizer Queue GC handle Unknown JNI Local Unfinalized Thread stack Unreachable JNI Global Thread block Thread Busy Monitor © 2011 SAP AG. All rights reserved. 10
  • 11. Getting started What is a leak? © 2011 SAP AG. All rights reserved. 11
  • 12. Agenda Getting started Get hands dirty Q&A © 2011 SAP AG. All rights reserved. 12
  • 13. Analyze memory consumption Getting the heap dump: Setup JConsole refuses to connect © 2011 SAP AG. All rights reserved. 13
  • 14. Analyze memory consumption DEMO © 2011 SAP AG. All rights reserved. 14
  • 15. How to get involved? Eclipse Home Page http://www.eclipse.org/mat/ Forum eclipse.technology.memory-analyzer Blog http://dev.eclipse.org/blogs/memoryanalyzer © 2011 SAP AG. All rights reserved. 15