SlideShare a Scribd company logo
Memory Leak

Overview and Tools
AGENDA









Overview of Java Heap
What is a Memory Leak
Symptoms of Memory Leaks
How to troubleshoot
Tools
Best Practices to avoid/detect Memory Leak
Q&A
Overview of Java Heap






Java Heap can be categorized into three generations: - Young, Tenured
and Permanent.
Young generation has Eden Space and two survivor spaces. All newly
created objects are kept in Eden Space and moved to one of the
survivor space after it survives few gc’s. From one survivor space it
moves to another. At an instant one of the survivor space is completely
free. From the survivor space, objects are moved to the tenured
generations.
Permanent holds class data, such as describing classes and methods.
What is a Memory Leak

Memory leak is when objects are not removed from
the heap even when they are not required.
This can be due to application code, application
server code, database driver or third party jar files.
Symptoms of Memory Leak






Very frequent FULL GC
Lesser memory is reclaimed on each Full GC
Available free heap keeps on decreasing over time
Response time decreases
How to troubleshoot

 Gather GC Information by adding the following JVM
flags
 -Xloggc=filename
 verbose:gc
 -XX:+PrintGCTimeStamps
 -XX:+PrintGCDetails
Tools

 Use GC Viewer to analyze the gc log
Jprofiler

 Memory profiling (Class Monitor, Allocation Monitor)
 Heap walker (Show all Class instances,
Allocations,References)
 CPU profiling (Invocation Tree, Hot spots, Method
Graph,CPU statistics)
Visual VM
Best Practices to avoid or detect Memory Leak

 Keep a watch on heap usage and use alert
mechanisms.
 Free up unnecessary objects.
 Close all connections in the finally block
 Don’t keep too much data in session.
Q&A

More Related Content

What's hot

JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
L&T Technology Services Limited
 
Spring framework
Spring frameworkSpring framework
Spring framework
Rajkumar Singh
 
Spring Boot
Spring BootSpring Boot
Spring Boot
koppenolski
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
Amr Salah
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
MustafaIbrahimy
 
Installation eclipse
Installation eclipseInstallation eclipse
Installation eclipse
srbhthkr
 
dotMemory 4 - What's inside?
dotMemory 4 - What's inside?dotMemory 4 - What's inside?
dotMemory 4 - What's inside?
Maarten Balliauw
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
Luzan Baral
 
Front end-security
Front end-securityFront end-security
Front end-security
Miao Siyu
 
Locators in selenium - BNT 09
Locators in selenium - BNT 09Locators in selenium - BNT 09
Locators in selenium - BNT 09
weekendtesting
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdm
Harshal Misalkar
 
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdfJVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
Bartłomiej Żyliński
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
Auwal Amshi
 
Method overloading
Method overloadingMethod overloading
Method overloading
Lovely Professional University
 
javascript.ppt
javascript.pptjavascript.ppt
javascript.ppt
MrsSChitradeviCommer
 
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Kuntal Bhowmick
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
Joseph de Castelnau
 
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
Andrew Khoury
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
Alex Movila
 
PHP.ppt
PHP.pptPHP.ppt

What's hot (20)

JavaScript Promises
JavaScript PromisesJavaScript Promises
JavaScript Promises
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
 
Polymorphism in oop
Polymorphism in oopPolymorphism in oop
Polymorphism in oop
 
Installation eclipse
Installation eclipseInstallation eclipse
Installation eclipse
 
dotMemory 4 - What's inside?
dotMemory 4 - What's inside?dotMemory 4 - What's inside?
dotMemory 4 - What's inside?
 
Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)Java DataBase Connectivity API (JDBC API)
Java DataBase Connectivity API (JDBC API)
 
Front end-security
Front end-securityFront end-security
Front end-security
 
Locators in selenium - BNT 09
Locators in selenium - BNT 09Locators in selenium - BNT 09
Locators in selenium - BNT 09
 
Introduction to method overloading & method overriding in java hdm
Introduction to method overloading & method overriding  in java  hdmIntroduction to method overloading & method overriding  in java  hdm
Introduction to method overloading & method overriding in java hdm
 
JVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdfJVM Under The Hood WDI.pdf
JVM Under The Hood WDI.pdf
 
Web container and Apache Tomcat
Web container and Apache TomcatWeb container and Apache Tomcat
Web container and Apache Tomcat
 
Method overloading
Method overloadingMethod overloading
Method overloading
 
javascript.ppt
javascript.pptjavascript.ppt
javascript.ppt
 
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
 
Node js introduction
Node js introductionNode js introduction
Node js introduction
 
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
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
PHP.ppt
PHP.pptPHP.ppt
PHP.ppt
 

Viewers also liked

Android - Preventing common memory leaks
Android - Preventing common memory leaksAndroid - Preventing common memory leaks
Android - Preventing common memory leaks
Ali Muzaffar
 
Identifying memory leaks in Android applications
Identifying memory leaks in Android applicationsIdentifying memory leaks in Android applications
Identifying memory leaks in Android applications
Zachary Blair
 
lightning talk : Android memory leak
lightning talk :  Android memory leaklightning talk :  Android memory leak
lightning talk : Android memory leak
Deivison Sporteman
 
Memory Leaks in Android Applications
Memory Leaks in Android ApplicationsMemory Leaks in Android Applications
Memory Leaks in Android Applications
Lokesh Ponnada
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_apps
Bin Shao
 
LCA13: Memory Hotplug on Android
LCA13: Memory Hotplug on AndroidLCA13: Memory Hotplug on Android
LCA13: Memory Hotplug on Android
Linaro
 
[Vietnam Mobile Day 2013] - Memory management for android applications
[Vietnam Mobile Day 2013] - Memory management for android applications[Vietnam Mobile Day 2013] - Memory management for android applications
[Vietnam Mobile Day 2013] - Memory management for android applications
AiTi Education
 
Static Memory Leak Detector
Static Memory Leak DetectorStatic Memory Leak Detector
Static Memory Leak Detector
Aditya Thatte
 
Detecting Memory Leaks in Android App
Detecting Memory Leaks in Android AppDetecting Memory Leaks in Android App
Detecting Memory Leaks in Android App
Dinesh Prajapati
 
Sun jdk 1.6内存管理 -使用篇
Sun jdk 1.6内存管理 -使用篇Sun jdk 1.6内存管理 -使用篇
Sun jdk 1.6内存管理 -使用篇bluedavy lin
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
Moabi.com
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detection
Võ Hòa
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
Attila Balazs
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
Minh Hoang
 
Detect all memory leaks with LeakCanary!
 Detect all memory leaks with LeakCanary! Detect all memory leaks with LeakCanary!
Detect all memory leaks with LeakCanary!
Pierre-Yves Ricau
 
AsyncTask アンチパターン
AsyncTask アンチパターンAsyncTask アンチパターン
AsyncTask アンチパターン
Hiroshi Kurokawa
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
Leon Chen
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
Terry Cho
 
Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Yoshinori Matsunobu
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
Kamal Maiti
 

Viewers also liked (20)

Android - Preventing common memory leaks
Android - Preventing common memory leaksAndroid - Preventing common memory leaks
Android - Preventing common memory leaks
 
Identifying memory leaks in Android applications
Identifying memory leaks in Android applicationsIdentifying memory leaks in Android applications
Identifying memory leaks in Android applications
 
lightning talk : Android memory leak
lightning talk :  Android memory leaklightning talk :  Android memory leak
lightning talk : Android memory leak
 
Memory Leaks in Android Applications
Memory Leaks in Android ApplicationsMemory Leaks in Android Applications
Memory Leaks in Android Applications
 
Memory management for_android_apps
Memory management for_android_appsMemory management for_android_apps
Memory management for_android_apps
 
LCA13: Memory Hotplug on Android
LCA13: Memory Hotplug on AndroidLCA13: Memory Hotplug on Android
LCA13: Memory Hotplug on Android
 
[Vietnam Mobile Day 2013] - Memory management for android applications
[Vietnam Mobile Day 2013] - Memory management for android applications[Vietnam Mobile Day 2013] - Memory management for android applications
[Vietnam Mobile Day 2013] - Memory management for android applications
 
Static Memory Leak Detector
Static Memory Leak DetectorStatic Memory Leak Detector
Static Memory Leak Detector
 
Detecting Memory Leaks in Android App
Detecting Memory Leaks in Android AppDetecting Memory Leaks in Android App
Detecting Memory Leaks in Android App
 
Sun jdk 1.6内存管理 -使用篇
Sun jdk 1.6内存管理 -使用篇Sun jdk 1.6内存管理 -使用篇
Sun jdk 1.6内存管理 -使用篇
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
C++ memory leak detection
C++ memory leak detectionC++ memory leak detection
C++ memory leak detection
 
Performance optimization techniques for Java code
Performance optimization techniques for Java codePerformance optimization techniques for Java code
Performance optimization techniques for Java code
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Detect all memory leaks with LeakCanary!
 Detect all memory leaks with LeakCanary! Detect all memory leaks with LeakCanary!
Detect all memory leaks with LeakCanary!
 
AsyncTask アンチパターン
AsyncTask アンチパターンAsyncTask アンチパターン
AsyncTask アンチパターン
 
Introduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission ControlIntroduction of Java GC Tuning and Java Java Mission Control
Introduction of Java GC Tuning and Java Java Mission Control
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)
 
Linux memory-management-kamal
Linux memory-management-kamalLinux memory-management-kamal
Linux memory-management-kamal
 

Similar to Memory leak

Mule memory leak issue
Mule memory leak issueMule memory leak issue
Mule memory leak issue
JeeHyunLim
 
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crash
Ajit Bhingarkar
 
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crash
Atharva Bhingarkar
 
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
sidg75
 
Java garbage collection, jvm, visual vm
Java garbage collection, jvm, visual vmJava garbage collection, jvm, visual vm
Java garbage collection, jvm, visual vm
Brad Schoening, MSCS
 
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
João Santana
 
Javasession10
Javasession10Javasession10
Javasession10
Rajeev Kumar
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
Mohamed Fathy
 
Sporar
SporarSporar
Sporar
oscon2007
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
Noam Kfir
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuning
Igor Igoroshka
 
Troubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VMTroubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VM
Poonam Bajaj Parhar
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
Ashish Bhasin
 
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
Maarten Balliauw
 
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
 
Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination Ext
Rohit Kelapure
 
Refactor to the Limit!
Refactor to the Limit!Refactor to the Limit!
Refactor to the Limit!
Jim Bethancourt
 
02D-Memory Management in Java.pptx
02D-Memory Management in Java.pptx02D-Memory Management in Java.pptx
02D-Memory Management in Java.pptx
AnhNhatNguyen5
 

Similar to Memory leak (20)

Mule memory leak issue
Mule memory leak issueMule memory leak issue
Mule memory leak issue
 
JVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crashJVM memory metrics and rules for detecting likely OOM caused crash
JVM memory metrics and rules for detecting likely OOM caused crash
 
JVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crashJVM memory metrics and rules for detecting possible OOM caused crash
JVM memory metrics and rules for detecting possible OOM caused crash
 
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
Garbage Collection, Tuning And Monitoring JVM In EBS 11i And R12
 
Java garbage collection, jvm, visual vm
Java garbage collection, jvm, visual vmJava garbage collection, jvm, visual vm
Java garbage collection, jvm, visual vm
 
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
 
Javasession10
Javasession10Javasession10
Javasession10
 
Short notes of oop with java
Short notes of oop with javaShort notes of oop with java
Short notes of oop with java
 
Sporar
SporarSporar
Sporar
 
Profiling JavaScript Performance
Profiling JavaScript PerformanceProfiling JavaScript Performance
Profiling JavaScript Performance
 
Jvm performance tuning
Jvm performance tuningJvm performance tuning
Jvm performance tuning
 
Troubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VMTroubleshooting Java HotSpot VM
Troubleshooting Java HotSpot VM
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012TechGIG_Memory leaks in_java_webnair_26th_july_2012
TechGIG_Memory leaks in_java_webnair_26th_july_2012
 
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
 
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
 
Web Sphere Problem Determination Ext
Web Sphere Problem Determination ExtWeb Sphere Problem Determination Ext
Web Sphere Problem Determination Ext
 
Refactor to the Limit!
Refactor to the Limit!Refactor to the Limit!
Refactor to the Limit!
 
02D-Memory Management in Java.pptx
02D-Memory Management in Java.pptx02D-Memory Management in Java.pptx
02D-Memory Management in Java.pptx
 

Recently uploaded

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Jeffrey Haguewood
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 

Recently uploaded (20)

June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 

Memory leak

  • 2. AGENDA        Overview of Java Heap What is a Memory Leak Symptoms of Memory Leaks How to troubleshoot Tools Best Practices to avoid/detect Memory Leak Q&A
  • 3. Overview of Java Heap    Java Heap can be categorized into three generations: - Young, Tenured and Permanent. Young generation has Eden Space and two survivor spaces. All newly created objects are kept in Eden Space and moved to one of the survivor space after it survives few gc’s. From one survivor space it moves to another. At an instant one of the survivor space is completely free. From the survivor space, objects are moved to the tenured generations. Permanent holds class data, such as describing classes and methods.
  • 4. What is a Memory Leak Memory leak is when objects are not removed from the heap even when they are not required. This can be due to application code, application server code, database driver or third party jar files.
  • 5. Symptoms of Memory Leak     Very frequent FULL GC Lesser memory is reclaimed on each Full GC Available free heap keeps on decreasing over time Response time decreases
  • 6. How to troubleshoot  Gather GC Information by adding the following JVM flags  -Xloggc=filename  verbose:gc  -XX:+PrintGCTimeStamps  -XX:+PrintGCDetails
  • 7. Tools  Use GC Viewer to analyze the gc log
  • 8. Jprofiler  Memory profiling (Class Monitor, Allocation Monitor)  Heap walker (Show all Class instances, Allocations,References)  CPU profiling (Invocation Tree, Hot spots, Method Graph,CPU statistics)
  • 10. Best Practices to avoid or detect Memory Leak  Keep a watch on heap usage and use alert mechanisms.  Free up unnecessary objects.  Close all connections in the finally block  Don’t keep too much data in session.
  • 11. Q&A