SlideShare a Scribd company logo
1 of 16
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
AEM | Heap Dump Analysis
Kanika Gera
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Heap Dump Analysis
• Java Heap Size & Concepts
• Concepts of Heap Dumps
• Memory Analyzer tools
• MAT
• Demo
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Java Heap Size & Concepts
 When a Java program starts, Java Virtual Machine gets some
memory from Operating System. Java Virtual Machine or JVM
uses this memory for all its need and part of this memory is call
java heap memory.
 The flag Xmx specifies the maximum memory allocation pool for
a Java Virtual Machine (JVM), while Xms specifies the initial
memory allocation pool. This means that your JVM will be started
with Xms amount of memory and will be able to use a maximum
of Xmx amount of memory.
 JVM also run garbage collector periodically to reclaim memory
back from dead objects. JVM expands Heap in Java some where
near to Maximum Heap Size specified by -Xmx and if there is no
more memory left for creating new object in java heap , JVM
throws java.lang.OutOfMemoryError and your application/AEM
dies by throwing OOM.
3
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
What is a HeapDump?
4
• A snapshot of the memory of a Java process
• It contains information about the java objects and classes in the heap:
All Objects - Class, fields, primitive values and references
All Classes - Classloader, name, super class, static fields
Garbage Collection Roots - Objects defined to be reachable by the JVM
Thread Stacks and Local Variables - The call-stacks of threads at the moment of the snapshot, and per
frame information about local objects
To generate heap dump we have to execute a JVM with the following parameters in eclipse
-XX:+HeapDumpOnOutOfMemoryError writes heap dump on first OutOfMemoryError
Here the heap dump will be generated in the “current directory” of the JVM by default. It can be explicitly
redirected with
-XX:HeapDumpPath= for example -XX: HeapDumpPath=/disk/myFolder.
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Shallow, Retained Heap
 Shallow heap is the memory consumed by one object. An object needs 32 or 64 bits
(depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytes per Long,
etc. Depending on the heap dump format the size may be adjusted (e.g. aligned to 8,
etc...) to model better the real consumption of the VM.
 Retained set of X is the set of objects which would be removed by GC when 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.
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Shallow vs Retained Heap
 The retained set for a leading set of objects, such as all objects of a particular class or all
objects of all classes loaded by a particular class loader or simply a bunch of arbitrary
objects, is the set of objects that is released if all objects of that leading set become
unaccessible. The retained set includes these objects as well as all other objects only
accessible through these objects. The retained size is the total heap size of all objects
contained in the retained set.
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Object Reference Graph
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
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.
 The immediate dominator x of some object y is the dominator closest to the object y.
 A dominator tree is built out of the object graph. In the dominator tree each object is the immediate
dominator of its children, so dependencies between the objects are easily identified.
The dominator tree has the following important properties:
 The objects belonging to the sub-tree of x (i.e. the objects dominated by x ) represent the retained set of
x .
 If x is the immediate dominator of y , then the immediate dominator of x also dominates y , and so on.
 The edges in the dominator tree do not directly correspond to object references from the object graph.
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Object graph to Dominator Tree
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Heap Analysis using MAT
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Heap Dump – Biggest Objects
11
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Heap Dump – Histogram
12
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Heap Dump – Histogram
13
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
Analyzing Threads
14
© 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential.
THANK YOU !
Heap Dump Analysis - AEM: Real World Issues

More Related Content

What's hot

Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOPDzmitry Naskou
 
Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationAmazon Web Services
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitJukka Zitting
 
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020AWSKRUG - AWS한국사용자모임
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewKris Rice
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API07.pallav
 
AWS CloudFormation Best Practices
AWS CloudFormation Best PracticesAWS CloudFormation Best Practices
AWS CloudFormation Best PracticesAmazon Web Services
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudTorin Sandall
 
MongoDB Fundamentals
MongoDB FundamentalsMongoDB Fundamentals
MongoDB FundamentalsMongoDB
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action Alex Movila
 

What's hot (20)

AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
Masterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormationMasterclass Webinar - AWS CloudFormation
Masterclass Webinar - AWS CloudFormation
 
Content Storage With Apache Jackrabbit
Content Storage With Apache JackrabbitContent Storage With Apache Jackrabbit
Content Storage With Apache Jackrabbit
 
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
Amplify를 통해 클라우드 기반 모바일 앱 개발하기 - 박태성(IDEASAM) :: AWS Community Day 2020
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
Java 8 streams
Java 8 streamsJava 8 streams
Java 8 streams
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
AWS CloudFormation Best Practices
AWS CloudFormation Best PracticesAWS CloudFormation Best Practices
AWS CloudFormation Best Practices
 
Spring security
Spring securitySpring security
Spring security
 
Spark sql
Spark sqlSpark sql
Spark sql
 
django
djangodjango
django
 
How Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their CloudHow Netflix Is Solving Authorization Across Their Cloud
How Netflix Is Solving Authorization Across Their Cloud
 
MongoDB Fundamentals
MongoDB FundamentalsMongoDB Fundamentals
MongoDB Fundamentals
 
Asp.net caching
Asp.net cachingAsp.net caching
Asp.net caching
 
Introduction to Amazon DynamoDB
Introduction to Amazon DynamoDBIntroduction to Amazon DynamoDB
Introduction to Amazon DynamoDB
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 

Similar to Heap Dump Analysis - AEM: Real World Issues

Eclipse Memory Analyzer - More Than Just a Heap Walker
Eclipse Memory Analyzer - More Than Just a Heap WalkerEclipse Memory Analyzer - More Than Just a Heap Walker
Eclipse Memory Analyzer - More Than Just a Heap Walkerguest62fd60c
 
Eclipse Memory Analyzer
Eclipse Memory AnalyzerEclipse Memory Analyzer
Eclipse Memory Analyzernayashkova
 
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in AndroidАлександр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in AndroidUA Mobile
 
Memory Leaks in Android Applications
Memory Leaks in Android ApplicationsMemory Leaks in Android Applications
Memory Leaks in Android ApplicationsLokesh Ponnada
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with PythonWill Schroeder
 
Java programing considering performance
Java programing considering performanceJava programing considering performance
Java programing considering performanceRoger Xia
 
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...licservernoida
 
CRUD Operation of images through XML
CRUD Operation of images through XMLCRUD Operation of images through XML
CRUD Operation of images through XMLAnshudha Maheshwari
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Yonik Seeley
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzJAXLondon2014
 
Amazon Elasticsearch Service Deep Dive - AWS Online Tech Talks
Amazon Elasticsearch Service Deep Dive - AWS Online Tech TalksAmazon Elasticsearch Service Deep Dive - AWS Online Tech Talks
Amazon Elasticsearch Service Deep Dive - AWS Online Tech TalksAmazon Web Services
 
Joshua bloch effect java chapter 3
Joshua bloch effect java   chapter 3Joshua bloch effect java   chapter 3
Joshua bloch effect java chapter 3Kamal Mukkamala
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right WayAndré Rømcke
 
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management....NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...NETFest
 
Wpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsWpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsRobin Aggarwal
 
Intro to JavaScript - Thinkful LA
Intro to JavaScript - Thinkful LAIntro to JavaScript - Thinkful LA
Intro to JavaScript - Thinkful LAThinkful
 
DotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETMaarten Balliauw
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft
 

Similar to Heap Dump Analysis - AEM: Real World Issues (20)

Eclipse Memory Analyzer - More Than Just a Heap Walker
Eclipse Memory Analyzer - More Than Just a Heap WalkerEclipse Memory Analyzer - More Than Just a Heap Walker
Eclipse Memory Analyzer - More Than Just a Heap Walker
 
Eclipse Memory Analyzer
Eclipse Memory AnalyzerEclipse Memory Analyzer
Eclipse Memory Analyzer
 
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in AndroidАлександр Терещук - Memory Analyzer Tool and memory optimization tips in Android
Александр Терещук - Memory Analyzer Tool and memory optimization tips in Android
 
Memory Leaks in Android Applications
Memory Leaks in Android ApplicationsMemory Leaks in Android Applications
Memory Leaks in Android Applications
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with Python
 
Java programing considering performance
Java programing considering performanceJava programing considering performance
Java programing considering performance
 
React native
React nativeReact native
React native
 
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...In class, we discussed min-heaps. In a min-heap the element of the heap with ...
In class, we discussed min-heaps. In a min-heap the element of the heap with ...
 
CRUD Operation of images through XML
CRUD Operation of images through XMLCRUD Operation of images through XML
CRUD Operation of images through XML
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
 
Reflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz KabutzReflection Madness - Dr. Heinz Kabutz
Reflection Madness - Dr. Heinz Kabutz
 
Amazon Elasticsearch Service Deep Dive - AWS Online Tech Talks
Amazon Elasticsearch Service Deep Dive - AWS Online Tech TalksAmazon Elasticsearch Service Deep Dive - AWS Online Tech Talks
Amazon Elasticsearch Service Deep Dive - AWS Online Tech Talks
 
Taming The JVM
Taming The JVMTaming The JVM
Taming The JVM
 
Joshua bloch effect java chapter 3
Joshua bloch effect java   chapter 3Joshua bloch effect java   chapter 3
Joshua bloch effect java chapter 3
 
PHP Benelux 2017 - Caching The Right Way
PHP Benelux 2017 -  Caching The Right WayPHP Benelux 2017 -  Caching The Right Way
PHP Benelux 2017 - Caching The Right Way
 
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management....NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...
.NET Fest 2018. Maarten Balliauw. Let’s refresh our memory! Memory management...
 
Wpf-Xaml And Layout Basics
Wpf-Xaml And Layout BasicsWpf-Xaml And Layout Basics
Wpf-Xaml And Layout Basics
 
Intro to JavaScript - Thinkful LA
Intro to JavaScript - Thinkful LAIntro to JavaScript - Thinkful LA
Intro to JavaScript - Thinkful LA
 
DotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NET
 
Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015Sperasoft‬ talks j point 2015
Sperasoft‬ talks j point 2015
 

More from Kanika Gera

Aem markdown importer github love in aem
Aem markdown importer  github love in aemAem markdown importer  github love in aem
Aem markdown importer github love in aemKanika Gera
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Kanika Gera
 
AEM target Integration
AEM target IntegrationAEM target Integration
AEM target IntegrationKanika Gera
 
AEM - Key Learning from Escalations
AEM - Key Learning from EscalationsAEM - Key Learning from Escalations
AEM - Key Learning from EscalationsKanika Gera
 
Aem asset optimizations & best practices
Aem asset optimizations & best practicesAem asset optimizations & best practices
Aem asset optimizations & best practicesKanika Gera
 
AEM MSM: Basics & More
AEM MSM: Basics & MoreAEM MSM: Basics & More
AEM MSM: Basics & MoreKanika Gera
 
MSM Basics & More
MSM Basics & MoreMSM Basics & More
MSM Basics & MoreKanika Gera
 
Intelligent assets_kanikagera
Intelligent assets_kanikageraIntelligent assets_kanikagera
Intelligent assets_kanikageraKanika Gera
 

More from Kanika Gera (10)

Aem markdown importer github love in aem
Aem markdown importer  github love in aemAem markdown importer  github love in aem
Aem markdown importer github love in aem
 
Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction Node.Js: Basics Concepts and Introduction
Node.Js: Basics Concepts and Introduction
 
AEM target Integration
AEM target IntegrationAEM target Integration
AEM target Integration
 
AEM - Key Learning from Escalations
AEM - Key Learning from EscalationsAEM - Key Learning from Escalations
AEM - Key Learning from Escalations
 
Aem asset optimizations & best practices
Aem asset optimizations & best practicesAem asset optimizations & best practices
Aem asset optimizations & best practices
 
AEM MSM: Basics & More
AEM MSM: Basics & MoreAEM MSM: Basics & More
AEM MSM: Basics & More
 
MSM Basics & More
MSM Basics & MoreMSM Basics & More
MSM Basics & More
 
Intelligent assets_kanikagera
Intelligent assets_kanikageraIntelligent assets_kanikagera
Intelligent assets_kanikagera
 
ace 2015 (1)
ace 2015 (1)ace 2015 (1)
ace 2015 (1)
 
ace 2015
ace 2015ace 2015
ace 2015
 

Recently uploaded

Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
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
 
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
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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...
 
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...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
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
 
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
 

Heap Dump Analysis - AEM: Real World Issues

  • 1. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. AEM | Heap Dump Analysis Kanika Gera
  • 2. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Heap Dump Analysis • Java Heap Size & Concepts • Concepts of Heap Dumps • Memory Analyzer tools • MAT • Demo
  • 3. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Java Heap Size & Concepts  When a Java program starts, Java Virtual Machine gets some memory from Operating System. Java Virtual Machine or JVM uses this memory for all its need and part of this memory is call java heap memory.  The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.  JVM also run garbage collector periodically to reclaim memory back from dead objects. JVM expands Heap in Java some where near to Maximum Heap Size specified by -Xmx and if there is no more memory left for creating new object in java heap , JVM throws java.lang.OutOfMemoryError and your application/AEM dies by throwing OOM. 3
  • 4. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. What is a HeapDump? 4 • A snapshot of the memory of a Java process • It contains information about the java objects and classes in the heap: All Objects - Class, fields, primitive values and references All Classes - Classloader, name, super class, static fields Garbage Collection Roots - Objects defined to be reachable by the JVM Thread Stacks and Local Variables - The call-stacks of threads at the moment of the snapshot, and per frame information about local objects To generate heap dump we have to execute a JVM with the following parameters in eclipse -XX:+HeapDumpOnOutOfMemoryError writes heap dump on first OutOfMemoryError Here the heap dump will be generated in the “current directory” of the JVM by default. It can be explicitly redirected with -XX:HeapDumpPath= for example -XX: HeapDumpPath=/disk/myFolder.
  • 5. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Shallow, Retained Heap  Shallow heap is the memory consumed by one object. An object needs 32 or 64 bits (depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytes per Long, etc. Depending on the heap dump format the size may be adjusted (e.g. aligned to 8, etc...) to model better the real consumption of the VM.  Retained set of X is the set of objects which would be removed by GC when 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.
  • 6. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Shallow vs Retained Heap  The retained set for a leading set of objects, such as all objects of a particular class or all objects of all classes loaded by a particular class loader or simply a bunch of arbitrary objects, is the set of objects that is released if all objects of that leading set become unaccessible. The retained set includes these objects as well as all other objects only accessible through these objects. The retained size is the total heap size of all objects contained in the retained set.
  • 7. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Object Reference Graph
  • 8. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. 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.  The immediate dominator x of some object y is the dominator closest to the object y.  A dominator tree is built out of the object graph. In the dominator tree each object is the immediate dominator of its children, so dependencies between the objects are easily identified. The dominator tree has the following important properties:  The objects belonging to the sub-tree of x (i.e. the objects dominated by x ) represent the retained set of x .  If x is the immediate dominator of y , then the immediate dominator of x also dominates y , and so on.  The edges in the dominator tree do not directly correspond to object references from the object graph.
  • 9. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Object graph to Dominator Tree
  • 10. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Heap Analysis using MAT
  • 11. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Heap Dump – Biggest Objects 11
  • 12. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Heap Dump – Histogram 12
  • 13. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Heap Dump – Histogram 13
  • 14. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. Analyzing Threads 14
  • 15. © 2017 Adobe Systems Incorporated. All Rights Reserved. Adobe Confidential. THANK YOU !

Editor's Notes

  1. On the right, you'll find the size of the dump and the number of classes, objects and class loaders. Right below, the pie chart gives an impression on the biggest objects in the dump. Move your mouse over a slice to see the details of the objects in the object inspector on the left. Click on any slice to drill down and follow for example the outgoing references.
  2. The Memory Analyzer displays by default the retained size of individual objects. However, the retained size of a set of objects - in this case all instances of a particular class - needs to be calculated.
  3. The Memory Analyzer displays by default the retained size of individual objects. However, the retained size of a set of objects - in this case all instances of a particular class - needs to be calculated. To approximate the retained sizes for all rows, pick icon from the tool bar. Alternatively, select a couple rows and use the context menu. Using the context menu , you can drill-down into the set of objects which the selected row represents. For example, you can list the objects with outgoing or incoming references. Or group the objects by the value of an attribute. Or group the collections by their size. Or or or... One thing that makes the Memory Analyzer so powerful is the fact that one can run any action on any set of objects. Just drill down and slice your objects the way you need them.
  4. You can proceed with the analysis of a single thread by using Java Basics > Thread Details context menu. Memory Analyzer provides an extension point, such that extensions can provide semantic information about the threads activity. The result of the Thread Details query will contain such information (if available), some overview information, and possibly the stacktrace of the thread. For DTFJ based dumps (IBM system dumps and IBM PHD files with associated java dump) the thread details view gives more information, including the thread state, priority and native stack trace.