• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
EclipseMAT
 

EclipseMAT

on

  • 493 views

 

Statistics

Views

Total Views
493
Views on SlideShare
493
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    EclipseMAT EclipseMAT Presentation Transcript

    • Ali Bahu11/26/2012ECLIPSE MEMORY ANALYZER(MAT)
    • INTRODUCTION The Java Garbage Collector releases Java objects from memory aslong as no other object refers to that object. A Java heap dump is animage of the complete Java object graph at a certain point in time. Itincludes all objects, Fields, Primitive types and object references. It ispossible to instruct the JVM to automatically create a heap dump incase of a OutOfMemoryError. The Eclipse MAT helps to visualize (based on Java heap dumps) thereferences to objects and provides tools to identify potential memoryleaks. It also helps with reduction in memory consumption. .
    • INTRODUCTION Eclipse MAT quickly analyzes: Productive heap dumps with hundreds of millions of objects Quickly calculates the retained sizes of objects, Checks who is preventing the Garbage Collector from collectingobjects Runs a report to automatically extract leak suspects. To tell the JVM to create a heapdump in case of anOutOfMemoryError use the option:-XX:+HeapDumpOnOutOfMemoryError
    • INSTALLATION Install Eclipse MAT via the Eclipse Update manager. Select "General Purpose Tools " and install: "Memory Analyser (Incubation)" "Memory Analyser (Charts)"
    • HOW TO USE ECLIPSE-MAT Create the Java project “com.fedex.test.first" and the package " com.fedex.test.first “and Create the following class:Package com.fedex.test.first;import java.util.ArrayList;import java.util.List;public class Main{public static void main(String[] args){List<String> list = new ArrayList<String>(); while (1<2){list.add("OutOfMemoryError test");} } }
    • RUN PROJECT In Eclipse add the -XX:+HeapDumpOnOutOfMemoryError tothe runtime configuration and run the project.
    • USING ECLIPSE-MAT You should get a new file in your project (.hprof). You may need to refresh your project (F5 on the project) if you areunable to see the file. Double-click it and select"Leak Suspects Report".
    • ANALYSIS Switch back to the overview and start your investigation of the heapdump. The user interface is quite intuitive. Especially the dominatortree gives a quick overview of the objects being used. You can also create a HeapDump via the jconsole. You can try that bytyping jconsole in the command line to start it.