SlideShare a Scribd company logo
Vladimir Pavlov Dimitar Giormov SAP Labs Bulgaria Using and Extending Memory Analyzer into Uncharted Waters Memory Analyzer
Introduction The Headaches Eclipse Memory Analyzer Extending Eclipse Memory Analyzer API and Extension Points JRuby Case Android Apps Case Q & A © SAP 2010 / Page
Memory leaks Hard to debug and find the root cause Eventually lead to OOM errors    Brings your system down    Often not reproducible Thread issues Deadlocks Exhausted threads Waiting for an external resource – e.g. DB connection    Application does not respond    Whole system hangs THE HEADACHES © SAP 2010 / Page
Eclipse Memory Analyzer  (MAT) is… Java heap analyzer Helps find memory leaks and reduce memory consumption UI and programmatic access to data in the heap dumps Multi-Gigabyte Java Heap Dumps Are Nothing to Fear Now Soooo much faster than other tools, e.g. jhat Very little memory “overhead” for processing heap dumps (again – cf. jhat) Supports Sun, SAP, HP, IBM JDKs 1.4.2 and above Automatic problem recognition Could also process thread dumps and correlate data to provide additional details Initial contribution from SAP, joined by IBM Highly extensible ECLIPSE MEMORY ANALYZER © SAP 2010 / Page  Memory Analyzer
 
Why extend MAT? To save time doing the same thing repeatedly To help others use the same technique as you To do things not possible from the GUI To build in application or domain specific logic How to extend MAT? MAT provides a set of Eclipse extension points User writes an extension plug-in MAT provides an API for reading data from a heap dump EXTENDING MAT © SAP 2010 / Page
Isnapshot Represents a heap dump Methods for reading classes and objects, getting sizes, GC roots, referenced objects, etc. Object model IClass IObject IInstance IClassLoader IArray IPrimitiveArray IObjectArray PROGRAMMATIC ACCESS TO A SNAPSHOT © SAP 2010 / Page
Name Resolver Used to give meaningful descriptions of objects Similar to a toString() method Extension point:  org.eclipse.mat.api.nameResolver Query Used for exploring dumps or detailed analysis Result in the form of a table, tree, histogram, pie chart, free text... Integrated into MAT’s menus “ Collaboration” of queries Extension point:  org.eclipse.mat.report.query Request Resolver Used to provide details about what a thread was doing Contributes to Leak Suspects report Extension point:  org.eclipse.mat.api.requestResolver EXTENSION POINTS © SAP 2010 / Page
Parser – for new heap dump types and VMs, such as for Jikes RVM Trigger Heap Dump – org.eclipse.mat.api.heapDumpProvider For new VM types Reports – org.eclipse.mat.report.report HTML results of queries – also used for batch mode Thread Resolver – additional thread data such as native stacks Ticket Resolver – can identify appropriate routing for problems Based on classes and class loaders of problematic objects Rendering – org.eclipse.mat.api.renderer Additional to HTML and CSV Annotations used as filters and for configuration EXTENSION POINTS (CONTD.) © SAP 2010 / Page
Ruby  is… Dynamic  scripting language Object-oriented Focus on simplicity and productivity Elegant syntax, natural to read and easy to write JRuby  is… 100% Java implementation of the Ruby programming language Interpreter running atop the JVM Generating Java bytecode (JIT compilation mode) Tight integration with Java RUBY AND JRUBY © SAP 2010 / Page
Adding JRuby into the picture… THE HEADACHES – AGGRAVATED © SAP 2010 / Page
 
What were the goals Identify memory leaks (critical when talking about embedded systems due to hardware restrictions) Filter memory usage by classes belonging to the users’ application Simpler workflow: developers start analyzing by classes they already know (not Android system classes) Why MAT was chosen The MAT perspective provides views to analyze application status, identify leaks, and so on, given an  HPROF  file Reports are easy to navigate and provide information about retained heap It is Eclipse based Android supports the creation and extraction of  HPROF  files MAT INTEGRATION WITH MOTODEV STUDIO
Implemented an Extension Extension point used:  org.eclipse.mat.ui Added a new page extending  CompositeHeapEditorPane Created  MotodevPane  based on  OQLPane class WORK DONE ON MAT
The integration of MOTODEV Studio, Google DDMS and Eclipse MAT worked very well. Used the  org.eclipse.mat.ui  extension point, which was well-documented. It took about 2 weeks of one developer to study the project, implement and test the solution. OVERALL EXPERIENCE
Eclipse Memory Analyzer provides: Powerful and efficient  memory analysis features out-of-the-box API for extracting data from a heap dump Application or domain specific analysis can be added as extensions SUMMARY © SAP 2010 / Page
RESOURCES © SAP 2010 / Page
THANK YOU! in:  vpavlov t:  @giormov Memory Analyzer
Ad

More Related Content

Similar to Using and Extending Memory Analyzer into Uncharted Waters (20)

AI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
AI/ML Infra Meetup | How Uber Optimizes LLM Training and FinetuneAI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
AI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
Alluxio, Inc.
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
Lars Vogel
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
jphl
 
Cloud Computing Bootcamp On The Google App Engine [v1.1]
Cloud Computing Bootcamp On The Google App Engine [v1.1]Cloud Computing Bootcamp On The Google App Engine [v1.1]
Cloud Computing Bootcamp On The Google App Engine [v1.1]
Matthew McCullough
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)
Kevin Gill
 
Big Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source ToolkitsBig Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source Toolkits
DataWorks Summit
 
Vipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentationVipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentation
Vipul Divyanshu
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
Kaxil Naik
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
Bhupesh Bansal
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
Hadoop User Group
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2
Pascal Rapicault
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Mack Hardy
 
Spsmi13 charts
Spsmi13 chartsSpsmi13 charts
Spsmi13 charts
Derek Gusoff
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
Chris Adkin
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Steven Smith
 
Reusable Learning Objects: Designing and Archiving
Reusable Learning Objects: Designing and ArchivingReusable Learning Objects: Designing and Archiving
Reusable Learning Objects: Designing and Archiving
Ishan Abeywardena, Ph.D.
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
Walter Liu
 
Fowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing WorkshopFowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing Workshop
Mark Masterson
 
AI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
AI/ML Infra Meetup | How Uber Optimizes LLM Training and FinetuneAI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
AI/ML Infra Meetup | How Uber Optimizes LLM Training and Finetune
Alluxio, Inc.
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
Lars Vogel
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
jphl
 
Cloud Computing Bootcamp On The Google App Engine [v1.1]
Cloud Computing Bootcamp On The Google App Engine [v1.1]Cloud Computing Bootcamp On The Google App Engine [v1.1]
Cloud Computing Bootcamp On The Google App Engine [v1.1]
Matthew McCullough
 
HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)HTML5 - The Python Angle (PyCon Ireland 2010)
HTML5 - The Python Angle (PyCon Ireland 2010)
Kevin Gill
 
Big Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source ToolkitsBig Data Analytics-Open Source Toolkits
Big Data Analytics-Open Source Toolkits
DataWorks Summit
 
Vipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentationVipul divyanshu mahout_documentation
Vipul divyanshu mahout_documentation
Vipul Divyanshu
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
Kaxil Naik
 
Bhupeshbansal bigdata
Bhupeshbansal bigdata Bhupeshbansal bigdata
Bhupeshbansal bigdata
Bhupesh Bansal
 
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Voldemort & Hadoop @ Linkedin, Hadoop User Group Jan 2010
Bhupesh Bansal
 
Hadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedInHadoop and Voldemort @ LinkedIn
Hadoop and Voldemort @ LinkedIn
Hadoop User Group
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
vstorm83
 
Managing Your Runtime With P2
Managing Your Runtime With P2Managing Your Runtime With P2
Managing Your Runtime With P2
Pascal Rapicault
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Mack Hardy
 
J2EE Batch Processing
J2EE Batch ProcessingJ2EE Batch Processing
J2EE Batch Processing
Chris Adkin
 
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Design Pattern Mastery - Momentum Dev Con 19 Apr 2018
Steven Smith
 
Reusable Learning Objects: Designing and Archiving
Reusable Learning Objects: Designing and ArchivingReusable Learning Objects: Designing and Archiving
Reusable Learning Objects: Designing and Archiving
Ishan Abeywardena, Ph.D.
 
Airflow - a data flow engine
Airflow - a data flow engineAirflow - a data flow engine
Airflow - a data flow engine
Walter Liu
 
Fowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing WorkshopFowa Miami 09 Cloud Computing Workshop
Fowa Miami 09 Cloud Computing Workshop
Mark Masterson
 

Recently uploaded (20)

Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Cybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and MitigationCybersecurity Threat Vectors and Mitigation
Cybersecurity Threat Vectors and Mitigation
VICTOR MAESTRE RAMIREZ
 
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptxDevOpsDays SLC - Platform Engineers are Product Managers.pptx
DevOpsDays SLC - Platform Engineers are Product Managers.pptx
Justin Reock
 
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptxTop 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
Top 5 Benefits of Using Molybdenum Rods in Industrial Applications.pptx
mkubeusa
 
May Patch Tuesday
May Patch TuesdayMay Patch Tuesday
May Patch Tuesday
Ivanti
 
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
On-Device or Remote? On the Energy Efficiency of Fetching LLM-Generated Conte...
Ivano Malavolta
 
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Limecraft Webinar - 2025.3 release, featuring Content Delivery, Graphic Conte...
Maarten Verwaest
 
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025Zilliz Cloud Monthly Technical Review: May 2025
Zilliz Cloud Monthly Technical Review: May 2025
Zilliz
 
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
The No-Code Way to Build a Marketing Team with One AI Agent (Download the n8n...
SOFTTECHHUB
 
Viam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdfViam product demo_ Deploying and scaling AI with hardware.pdf
Viam product demo_ Deploying and scaling AI with hardware.pdf
camilalamoratta
 
fennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solutionfennec fox optimization algorithm for optimal solution
fennec fox optimization algorithm for optimal solution
shallal2
 
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptxReimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
Reimagine How You and Your Team Work with Microsoft 365 Copilot.pptx
John Moore
 
AsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API DesignAsyncAPI v3 : Streamlining Event-Driven API Design
AsyncAPI v3 : Streamlining Event-Driven API Design
leonid54
 
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdfKit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Kit-Works Team Study_팀스터디_김한솔_nuqs_20250509.pdf
Wonjun Hwang
 
Q1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor PresentationQ1 2025 Dropbox Earnings and Investor Presentation
Q1 2025 Dropbox Earnings and Investor Presentation
Dropbox
 
AI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of DocumentsAI Agents at Work: UiPath, Maestro & the Future of Documents
AI Agents at Work: UiPath, Maestro & the Future of Documents
UiPathCommunity
 
Building the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdfBuilding the Customer Identity Community, Together.pdf
Building the Customer Identity Community, Together.pdf
Cheryl Hung
 
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Kit-Works Team Study_아직도 Dockefile.pdf_김성호
Wonjun Hwang
 
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Integrating FME with Python: Tips, Demos, and Best Practices for Powerful Aut...
Safe Software
 
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Optima Cyber - Maritime Cyber Security - MSSP Services - Manolis Sfakianakis ...
Mike Mingos
 
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier VroomAI x Accessibility UXPA by Stew Smith and Olivier Vroom
AI x Accessibility UXPA by Stew Smith and Olivier Vroom
UXPA Boston
 
Ad

Using and Extending Memory Analyzer into Uncharted Waters

  • 1. Vladimir Pavlov Dimitar Giormov SAP Labs Bulgaria Using and Extending Memory Analyzer into Uncharted Waters Memory Analyzer
  • 2. Introduction The Headaches Eclipse Memory Analyzer Extending Eclipse Memory Analyzer API and Extension Points JRuby Case Android Apps Case Q & A © SAP 2010 / Page
  • 3. Memory leaks Hard to debug and find the root cause Eventually lead to OOM errors  Brings your system down  Often not reproducible Thread issues Deadlocks Exhausted threads Waiting for an external resource – e.g. DB connection  Application does not respond  Whole system hangs THE HEADACHES © SAP 2010 / Page
  • 4. Eclipse Memory Analyzer (MAT) is… Java heap analyzer Helps find memory leaks and reduce memory consumption UI and programmatic access to data in the heap dumps Multi-Gigabyte Java Heap Dumps Are Nothing to Fear Now Soooo much faster than other tools, e.g. jhat Very little memory “overhead” for processing heap dumps (again – cf. jhat) Supports Sun, SAP, HP, IBM JDKs 1.4.2 and above Automatic problem recognition Could also process thread dumps and correlate data to provide additional details Initial contribution from SAP, joined by IBM Highly extensible ECLIPSE MEMORY ANALYZER © SAP 2010 / Page Memory Analyzer
  • 5.  
  • 6. Why extend MAT? To save time doing the same thing repeatedly To help others use the same technique as you To do things not possible from the GUI To build in application or domain specific logic How to extend MAT? MAT provides a set of Eclipse extension points User writes an extension plug-in MAT provides an API for reading data from a heap dump EXTENDING MAT © SAP 2010 / Page
  • 7. Isnapshot Represents a heap dump Methods for reading classes and objects, getting sizes, GC roots, referenced objects, etc. Object model IClass IObject IInstance IClassLoader IArray IPrimitiveArray IObjectArray PROGRAMMATIC ACCESS TO A SNAPSHOT © SAP 2010 / Page
  • 8. Name Resolver Used to give meaningful descriptions of objects Similar to a toString() method Extension point: org.eclipse.mat.api.nameResolver Query Used for exploring dumps or detailed analysis Result in the form of a table, tree, histogram, pie chart, free text... Integrated into MAT’s menus “ Collaboration” of queries Extension point: org.eclipse.mat.report.query Request Resolver Used to provide details about what a thread was doing Contributes to Leak Suspects report Extension point: org.eclipse.mat.api.requestResolver EXTENSION POINTS © SAP 2010 / Page
  • 9. Parser – for new heap dump types and VMs, such as for Jikes RVM Trigger Heap Dump – org.eclipse.mat.api.heapDumpProvider For new VM types Reports – org.eclipse.mat.report.report HTML results of queries – also used for batch mode Thread Resolver – additional thread data such as native stacks Ticket Resolver – can identify appropriate routing for problems Based on classes and class loaders of problematic objects Rendering – org.eclipse.mat.api.renderer Additional to HTML and CSV Annotations used as filters and for configuration EXTENSION POINTS (CONTD.) © SAP 2010 / Page
  • 10. Ruby is… Dynamic scripting language Object-oriented Focus on simplicity and productivity Elegant syntax, natural to read and easy to write JRuby is… 100% Java implementation of the Ruby programming language Interpreter running atop the JVM Generating Java bytecode (JIT compilation mode) Tight integration with Java RUBY AND JRUBY © SAP 2010 / Page
  • 11. Adding JRuby into the picture… THE HEADACHES – AGGRAVATED © SAP 2010 / Page
  • 12.  
  • 13. What were the goals Identify memory leaks (critical when talking about embedded systems due to hardware restrictions) Filter memory usage by classes belonging to the users’ application Simpler workflow: developers start analyzing by classes they already know (not Android system classes) Why MAT was chosen The MAT perspective provides views to analyze application status, identify leaks, and so on, given an HPROF file Reports are easy to navigate and provide information about retained heap It is Eclipse based Android supports the creation and extraction of HPROF files MAT INTEGRATION WITH MOTODEV STUDIO
  • 14. Implemented an Extension Extension point used: org.eclipse.mat.ui Added a new page extending CompositeHeapEditorPane Created MotodevPane based on OQLPane class WORK DONE ON MAT
  • 15. The integration of MOTODEV Studio, Google DDMS and Eclipse MAT worked very well. Used the org.eclipse.mat.ui extension point, which was well-documented. It took about 2 weeks of one developer to study the project, implement and test the solution. OVERALL EXPERIENCE
  • 16. Eclipse Memory Analyzer provides: Powerful and efficient memory analysis features out-of-the-box API for extracting data from a heap dump Application or domain specific analysis can be added as extensions SUMMARY © SAP 2010 / Page
  • 17. RESOURCES © SAP 2010 / Page
  • 18. THANK YOU! in: vpavlov t: @giormov Memory Analyzer

Editor's Notes

  • #14: Hprof is the file that MAT plugins are able to load and display memory reports Retained heap is the memory kept alive by a class X
  • #15: CompositeHeapEditorPane is the base class for the pages inside MAT report OQLPane is a page that shows memory usage and have an edit field to filter classes in the report using a syntax similar to SQL (called OQL – object query language) MotodevPane (see picture) generates the filter selecting the Android application package (e.g.: the statement with “com.a.*” for the user).
  • #16: It would be interesting to mention that in the 2-week time, we also p rovided methods to pull MAT files from phone/emulator integrated into our Device Manager view
  翻译: