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

클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018 클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
Amazon Web Services Korea
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Hadoop REST API Security with Apache Knox Gateway
Hadoop REST API Security with Apache Knox GatewayHadoop REST API Security with Apache Knox Gateway
Hadoop REST API Security with Apache Knox Gateway
DataWorks Summit
 

What's hot (20)

週末趣味のAWS VPC Traffic Mirroring
週末趣味のAWS VPC Traffic Mirroring週末趣味のAWS VPC Traffic Mirroring
週末趣味のAWS VPC Traffic Mirroring
 
클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018 클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
클라우드 여정을 성공적으로 수행하기 위한 AWS IAM 활용 전략::최원근:: AWS Summit Seoul 2018
 
OLAP for Big Data (Druid vs Apache Kylin vs Apache Lens)
OLAP for Big Data (Druid vs Apache Kylin vs Apache Lens)OLAP for Big Data (Druid vs Apache Kylin vs Apache Lens)
OLAP for Big Data (Druid vs Apache Kylin vs Apache Lens)
 
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
대용량 데이터레이크 마이그레이션 사례 공유 [카카오게임즈 - 레벨 200] - 조은희, 팀장, 카카오게임즈 ::: Games on AWS ...
 
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기Aws glue를 통한 손쉬운 데이터 전처리 작업하기
Aws glue를 통한 손쉬운 데이터 전처리 작업하기
 
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
AWS DMS를 통한 오라클 DB 마이그레이션 방법 - AWS Summit Seoul 2017
 
Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理Amazon Kinesis Familyを活用したストリームデータ処理
Amazon Kinesis Familyを活用したストリームデータ処理
 
AEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser CachingAEM (CQ) Dispatcher Security and CDN+Browser Caching
AEM (CQ) Dispatcher Security and CDN+Browser Caching
 
Ambari Views - Overview
Ambari Views - OverviewAmbari Views - Overview
Ambari Views - Overview
 
わかりづらいS3クロスアカウントアクセス許可に立ち向かおう
わかりづらいS3クロスアカウントアクセス許可に立ち向かおうわかりづらいS3クロスアカウントアクセス許可に立ち向かおう
わかりづらいS3クロスアカウントアクセス許可に立ち向かおう
 
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
AWS 기반 클라우드 아키텍처 모범사례 - 삼성전자 개발자 포털/개발자 워크스페이스 - 정영준 솔루션즈 아키텍트, AWS / 유현성 수석,...
 
Oak, the Architecture of the new Repository
Oak, the Architecture of the new RepositoryOak, the Architecture of the new Repository
Oak, the Architecture of the new Repository
 
Amazon EFS (Elastic File System) 이해하고사용하기
Amazon EFS (Elastic File System) 이해하고사용하기Amazon EFS (Elastic File System) 이해하고사용하기
Amazon EFS (Elastic File System) 이해하고사용하기
 
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
AWS Lambda 내부 동작 방식 및 활용 방법 자세히 살펴 보기 - 김일호 솔루션즈 아키텍트 매니저, AWS :: AWS Summit ...
 
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
AWS Fargate와 Amazon ECS를 사용한 CI/CD 베스트 프랙티스 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Build...
 
AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기
AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기
AWS Finance Symposium_바로 도입할 수 있는 금융권 업무의 클라우드 아키텍처 알아보기
 
Hadoop REST API Security with Apache Knox Gateway
Hadoop REST API Security with Apache Knox GatewayHadoop REST API Security with Apache Knox Gateway
Hadoop REST API Security with Apache Knox Gateway
 
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
 Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
Spark Operator—Deploy, Manage and Monitor Spark clusters on Kubernetes
 
Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon RedshiftBuilding a Modern Data Warehouse - Deep Dive on Amazon Redshift
Building a Modern Data Warehouse - Deep Dive on Amazon Redshift
 
Aws schema conversion tool
Aws schema conversion toolAws schema conversion tool
Aws schema conversion tool
 

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 Walker
guest62fd60c
 
Eclipse Memory Analyzer
Eclipse Memory AnalyzerEclipse Memory Analyzer
Eclipse Memory Analyzer
nayashkova
 
Александр Терещук - 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
UA Mobile
 
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
 

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 (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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
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...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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.