Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Eclipse Memory Analyzer – More Than Just a Heap Walker Andrew Johnson (IBM) Elena Nayashkova (SAP)
Introduction <ul><li>Java memory-related problems are very common </li></ul><ul><li>Many are extremely difficult to analyz...
A Little Bit of History <ul><li>Problem #1: multi-GB heap dumps from 64-bit machines </li></ul><ul><ul><li>Quickly open an...
Agenda <ul><li>Support for IBM System Dumps </li></ul><ul><li>Automated Analysis </li></ul><ul><li>Equinox OSGi Bundle Exp...
IBM Dumps <ul><li>VM dumps differ between vendors (e.g. IBM and Sun) </li></ul><ul><li>Diagnostic Tooling Interface for Ja...
Demo <ul><li>DTFJ – adapter </li></ul><ul><ul><li>Acquire and open an IBM heap dump </li></ul></ul><ul><ul><li>Run applica...
Demo <ul><li>Memory Leak Hunter </li></ul><ul><ul><li>Automatically detect memory leak suspects </li></ul></ul><ul><ul><li...
Report Overview Any up-to-date architecture loads components with separate class loaders, be it OSGi or JEE application  s...
Report Details Accumulated objects A significant drop in the  retained sizes shows the accumulation point The chain of obj...
Demo <ul><li>Top Components Report </li></ul><ul><ul><li>Analyze components, that occupy more memory, than a certain thres...
Report Details
Report Details
Equinox OSGi Bundle Explorer <ul><li>Core runtime of Eclipse uses Equinox OSGi framework. A plug-in is an OSGi bundle. </l...
Demo <ul><li>Equinox OSGi Bundle  </li></ul><ul><li>Explorer </li></ul><ul><ul><li>Show the state of all bundles in the an...
What’s Next? <ul><li>Compare multiple heap dumps </li></ul><ul><li>Acquire heap dumps interactively </li></ul><ul><li>Beco...
Thank You! <ul><li>Memory Analyzer @ Eclipse:  </li></ul><ul><li>www.eclipse.org/mat   </li></ul><ul><li>IBM DTFJ-adapter ...
Binary Heap Dump <ul><li>A heap dump is a  snapshot of objects that are alive  at one point in time.  </li></ul><ul><li>  ...
How to Get a Heap Dump <ul><li>Non-Interactive </li></ul><ul><ul><li>-XX:+HeapDumpOnOutOfMemoryError </li></ul></ul><ul><l...
Shallow and Retained Size <ul><li>Shallow heap is the memory consumed by one object  </li></ul><ul><li>Retained set of  X ...
Dominator Tree <ul><li>The Dominator Tree is a Transformation of the Cyclic Object Graph into a “Keep-Alive” Tree: </li></...
Upcoming SlideShare
Loading in …5
×

of

Eclipse Memory Analyzer Slide 1 Eclipse Memory Analyzer Slide 2 Eclipse Memory Analyzer Slide 3 Eclipse Memory Analyzer Slide 4 Eclipse Memory Analyzer Slide 5 Eclipse Memory Analyzer Slide 6 Eclipse Memory Analyzer Slide 7 Eclipse Memory Analyzer Slide 8 Eclipse Memory Analyzer Slide 9 Eclipse Memory Analyzer Slide 10 Eclipse Memory Analyzer Slide 11 Eclipse Memory Analyzer Slide 12 Eclipse Memory Analyzer Slide 13 Eclipse Memory Analyzer Slide 14 Eclipse Memory Analyzer Slide 15 Eclipse Memory Analyzer Slide 16 Eclipse Memory Analyzer Slide 17 Eclipse Memory Analyzer Slide 18 Eclipse Memory Analyzer Slide 19 Eclipse Memory Analyzer Slide 20
Upcoming SlideShare
Distilling Dumps: a Guide to Using and Extending Memory Analyzer
Next
Download to read offline and view in fullscreen.

3 Likes

Share

Download to read offline

Eclipse Memory Analyzer

Download to read offline

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Eclipse Memory Analyzer

  1. 1. Eclipse Memory Analyzer – More Than Just a Heap Walker Andrew Johnson (IBM) Elena Nayashkova (SAP)
  2. 2. Introduction <ul><li>Java memory-related problems are very common </li></ul><ul><li>Many are extremely difficult to analyze </li></ul><ul><li>Analysis requires expertise in the analyzed source code </li></ul><ul><li>Eclipse Memory Analyzer: </li></ul><ul><ul><li>Simplifies memory analysis </li></ul></ul><ul><ul><li>Extensible </li></ul></ul><ul><ul><li>Free for download @ www.eclipse.org/mat </li></ul></ul>
  3. 3. A Little Bit of History <ul><li>Problem #1: multi-GB heap dumps from 64-bit machines </li></ul><ul><ul><li>Quickly open and re-open a heap dump on 32-bit machines </li></ul></ul><ul><li>Problem #2: millions of objects. Where is the „needle“? </li></ul><ul><ul><li>Dominator Tree: fast calculation of retained memory </li></ul></ul><ul><ul><li>Meaningful names for class loaders: see components </li></ul></ul><ul><ul><li>SQL-like language: create custom queries </li></ul></ul><ul><li>Problem #3: complexity of analysis </li></ul><ul><ul><li>Reports on memory leak suspects and checks for known antipatterns </li></ul></ul><ul><li>Problem #4: HPROF heap dumps only </li></ul><ul><ul><li>Support for IBM system dumps </li></ul></ul>
  4. 4. Agenda <ul><li>Support for IBM System Dumps </li></ul><ul><li>Automated Analysis </li></ul><ul><li>Equinox OSGi Bundle Explorer </li></ul>
  5. 5. IBM Dumps <ul><li>VM dumps differ between vendors (e.g. IBM and Sun) </li></ul><ul><li>Diagnostic Tooling Interface for Java (DTFJ) hides differences between dumps from different VMs </li></ul><ul><li>DTFJ is being standardized via JSR 326 </li></ul><ul><li>Need a VM option to get a system (= process) dump on OutOfMemoryError </li></ul><ul><li>System dumps are post-processed with JExtract </li></ul><ul><li>Adapter for MAT available from IBM to read the dumps </li></ul><ul><li>Adapter uses DTFJ to open the dump & read the object/class data, then passes the data into MAT </li></ul><ul><li>MAT then displays data just like an HPROF dump </li></ul>
  6. 6. Demo <ul><li>DTFJ – adapter </li></ul><ul><ul><li>Acquire and open an IBM heap dump </li></ul></ul><ul><ul><li>Run application with dump option java -Xdump:system:events=throw,filter=java/lang/OutOfMemoryError </li></ul></ul><ul><ul><li>Postprocess dump to add extra VM data jextract <name of dump> .dmp </li></ul></ul><ul><ul><li>Open the jextract-ed file in Memory Analyzer and analyze as Sun heap dump </li></ul></ul>
  7. 7. Demo <ul><li>Memory Leak Hunter </li></ul><ul><ul><li>Automatically detect memory leak suspects </li></ul></ul><ul><ul><li>Discover if the issue is known (and a fix available) </li></ul></ul><ul><ul><li>Collect details for in depth analysis by the code experts </li></ul></ul>
  8. 8. Report Overview Any up-to-date architecture loads components with separate class loaders, be it OSGi or JEE application servers. Extensible to display meaningful names. Classification for trouble ticket system: less ping-pong of trouble tickets. Search by keywords: identify if problem is known One big object: memory leak suspect
  9. 9. Report Details Accumulated objects A significant drop in the retained sizes shows the accumulation point The chain of objects and references which keep the suspect alive
  10. 10. Demo <ul><li>Top Components Report </li></ul><ul><ul><li>Analyze components, that occupy more memory, than a certain threshold </li></ul></ul><ul><ul><li>Give hints where memory footprint can be optimized </li></ul></ul><ul><ul><li>Check for known antipatterns </li></ul></ul>
  11. 11. Report Details
  12. 12. Report Details
  13. 13. Equinox OSGi Bundle Explorer <ul><li>Core runtime of Eclipse uses Equinox OSGi framework. A plug-in is an OSGi bundle. </li></ul><ul><li>For each bundle present in your Equinox-based application Memory Analyzer’s Bundle Explorer shows: </li></ul><ul><ul><li>name and version </li></ul></ul><ul><ul><li>state and location </li></ul></ul><ul><ul><li>dependencies and dependents </li></ul></ul><ul><ul><li>services contributed and consumed </li></ul></ul><ul><ul><li>extension points and extensions </li></ul></ul><ul><ul><li>hosted bundle fragments </li></ul></ul>
  14. 14. Demo <ul><li>Equinox OSGi Bundle </li></ul><ul><li>Explorer </li></ul><ul><ul><li>Show the state of all bundles in the analyzed application </li></ul></ul><ul><ul><li>What other bundles does my bundle depend on at runtime? </li></ul></ul><ul><ul><li>Detect duplicate bundles </li></ul></ul>
  15. 15. What’s Next? <ul><li>Compare multiple heap dumps </li></ul><ul><li>Acquire heap dumps interactively </li></ul><ul><li>Become part of Galileo Simultaneous Release </li></ul>
  16. 16. Thank You! <ul><li>Memory Analyzer @ Eclipse: </li></ul><ul><li>www.eclipse.org/mat </li></ul><ul><li>IBM DTFJ-adapter for Eclipse Memory Analyzer: </li></ul><ul><li>www.ibm.com/developerworks/java/jdk/tools/mat.html </li></ul><ul><li>Memory Analyzer Wiki @ SAP: </li></ul><ul><li>www.sdn.sap.com/irj/sdn/wiki?path =/display/Java/ Java+Memory+Analysis </li></ul><ul><li>Blogs: </li></ul><ul><li>dev.eclipse.org/blogs/memoryanalyzer </li></ul>
  17. 17. Binary Heap Dump <ul><li>A heap dump is a snapshot of objects that are alive at one point in time. </li></ul><ul><li> It contains: </li></ul><ul><ul><ul><ul><ul><li>Objects: fields, references, primitive values, … </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Classes: class loader, super class, static fields, … </li></ul></ul></ul></ul></ul><ul><ul><ul><li> A heap dump does not contain </li></ul></ul></ul><ul><ul><ul><ul><ul><li>where the objects have been created </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>which objects have been garbage collected </li></ul></ul></ul></ul></ul>For Your Reference IOIOII IOIIOI OIOIO IIOIIOI IOIOII IOIIOI OIOIO IIOIIOI
  18. 18. How to Get a Heap Dump <ul><li>Non-Interactive </li></ul><ul><ul><li>-XX:+HeapDumpOnOutOfMemoryError </li></ul></ul><ul><li>On Demand </li></ul><ul><ul><li>JDK1.4.2_12 and -XX:+HeapDumpOnCtrlBreak </li></ul></ul><ul><ul><li>JDK6 and Jconsole </li></ul></ul><ul><li>On IBM VMs -Xdump:system:events=throw,filter=java/lang/OutOfMemoryError, request=exclusive+prepwalk </li></ul><ul><li>More… </li></ul><ul><ul><li>http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump </li></ul></ul>For Your Reference
  19. 19. Shallow and Retained Size <ul><li>Shallow heap is the memory consumed by one object </li></ul><ul><li>Retained set of X is the set of objects that will be garbage collected if X is garbage collected </li></ul><ul><li>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 </li></ul>For Your Reference Set of elements Retained Set C C, F, G, J K K C, K C, F, G, J, K, I
  20. 20. Dominator Tree <ul><li>The Dominator Tree is a Transformation of the Cyclic Object Graph into a “Keep-Alive” Tree: </li></ul><ul><ul><li>Every node in the Tree is directly responsible for keeping alive its children </li></ul></ul><ul><ul><li>Object X dominates object Y if all paths from the roots to Y run through X </li></ul></ul>For Your Reference <ul><li>Benefits: </li></ul><ul><li>Fast calculation of the retained size (sum all children) </li></ul><ul><li>List of distinct big </li></ul><ul><li>objects (first level of the tree) </li></ul><ul><li>Fast identification of </li></ul><ul><li>responsible objects (just go up the tree) </li></ul>
  • fuyou001

    Sep. 20, 2012
  • justforregister

    Aug. 28, 2011
  • gengmao

    Dec. 14, 2009

Views

Total views

9,582

On Slideshare

0

From embeds

0

Number of embeds

133

Actions

Downloads

197

Shares

0

Comments

0

Likes

3

×