[BGOUG] Memory analyzer
Upcoming SlideShare
Loading in...5
×
 

[BGOUG] Memory analyzer

on

  • 1,964 views

A short introduction of Eclipse Memory analyzer and its basic features.

A short introduction of Eclipse Memory analyzer and its basic features.

Statistics

Views

Total Views
1,964
Slideshare-icon Views on SlideShare
1,963
Embed Views
1

Actions

Likes
2
Downloads
40
Comments
0

1 Embed 1

http://businessworldti.wordpress.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    [BGOUG] Memory analyzer [BGOUG] Memory analyzer Presentation Transcript

    • Eclipse Memory AnalyzerKrasimir SemerdzhievDevelopment Architect / SAP Labs Bulgaria
    • AgendaGetting startedGet hands dirtyQ&A© 2011 SAP AG. All rights reserved. 2
    • Getting startedFew assumptionsYou’ve passed beyond “Hello World” in JavaHello World apps tend not to require too much memoryYou’ve gotten an OutOfMemoryError at least once in your life :)You’re proficient already with Garbage CollectionAttended the previous BGOUG event GC session© 2011 SAP AG. All rights reserved. 3
    • Getting startedMemory analyzer basicsWorks with heap dumps – live snapshots of:© 2011 SAP AG. All rights reserved. 4
    • Getting startedHow to get a heap dumpNon-Interactive-XX:+HeapDumpOnOutOfMemoryErrorOn DemandJDK1.4.2_12+ and -XX:+HeapDumpOnCtrlBreakJDK6 and JConsole or VisualVMOn IBM VMs -Xdump:system:events=throw,filter=java/lang/OutOfMemoryError, request=exclusive+prepwalkMore…http://wiki.eclipse.org/index.php/MemoryAnalyzer#Getting_a_Heap_Dump© 2011 SAP AG. All rights reserved. 5
    • Getting startedShallow vs. Retained heapShallow heap is the memory consumed by one objectRetained set of X is the set of objects that will be garbage collected if X is garbagecollectedRetained heap of X is the sum of shallow sizes of all objects in the retained set ofX, i.e. memory kept alive by X Set of elements Retained Set C C, F, G, J K K C, K C, F, G, J, K, I© 2011 SAP AG. All rights reserved. 6
    • Getting startedDominator treeAn 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.In the dominator tree each object is the immediate dominator of its children, so dependencies between the objects are easily identified.© 2011 SAP AG. All rights reserved. 7
    • Getting startedDominator tree© 2011 SAP AG. All rights reserved. 8
    • Getting startedJava references – java.lang.ref Softly reachable Created Initialized Strongly reachable Finalized Weakly reachableSoft reference Phantom reachableGC will try to preserve the objectWill collect it prior to throwing OutOfMemoryErrorWeak referenceGC is free to reclaim the object.Phantom referenceTrack object collections© 2011 SAP AG. All rights reserved. 9
    • Getting startedGC roots in JavaKeeps the objects in heap from being collected by GC System Class Finalizer Queue GC handle Unknown JNI Local Unfinalized Thread stack Unreachable JNI Global Thread block Thread Busy Monitor© 2011 SAP AG. All rights reserved. 10
    • Getting startedWhat is a leak?© 2011 SAP AG. All rights reserved. 11
    • AgendaGetting startedGet hands dirtyQ&A© 2011 SAP AG. All rights reserved. 12
    • Analyze memory consumptionGetting the heap dump: SetupJConsole refuses to connect© 2011 SAP AG. All rights reserved. 13
    • Analyze memory consumptionDEMO© 2011 SAP AG. All rights reserved. 14
    • How to get involved?Eclipse Home Page http://www.eclipse.org/mat/Forum eclipse.technology.memory-analyzerBlog http://dev.eclipse.org/blogs/memoryanalyzer© 2011 SAP AG. All rights reserved. 15
    • Questions?Krasimir Semerdzhievkrasimir.semerdzhiev@sap.com
    • Thank You!Krasimir Semerdzhievkrasimir.semerdzhiev@sap.com