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.
Out Of Memory Analyze Your Java Heap
GC silver bullet•   Unreferenced memory cleared    Fragmentation cleanup    Incorrect understanding of data / structures• ...
Data / Structures•   Primitives vs Objects        Byte vs byte•   Overhead of structure    •   LinkedList vs ArrayList    ...
Packratting•   Unintentionally storing data        Unbounded caches    •   Classloaders    •   Containers / plugins       ...
What nowAvoid situation ;-)
Snapshot•   -XX:+HeapDumpOnCtrlBreak    -XX:+HeapDumpOnOutOfMemoryError    jmap -dump:format=b,file=snapshot.bin pid•   jc...
MAT              Eclipse Memory Analyzer              Eclipse Memory Analyzer•   Wizards    Compare•   Explore    Query
Watch out•   Can be large    Takes time to produce•   Can contain sensitive information
LInks    MAT http://www.eclipse.org/mat/    jconsole    http://docs.oracle.com/javase/7/docs/technotes/tools/share/jconsol...
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Javaforum   looking into the memory
Upcoming SlideShare
Loading in …5
×

Javaforum looking into the memory

1,628 views

Published on

Out Of Memory - Analyze Your Java Heap
A short introduction on why memory usage might not be what you expect it to be and tools for going deeper. Different ways for acquiring memory snapshots and how to examine them with MAT.
Roger Lindsjö, Ericsson

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Javaforum looking into the memory

  1. 1. Out Of Memory Analyze Your Java Heap
  2. 2. GC silver bullet• Unreferenced memory cleared Fragmentation cleanup Incorrect understanding of data / structures• Packratting
  3. 3. Data / Structures• Primitives vs Objects Byte vs byte• Overhead of structure • LinkedList vs ArrayList JVM settings • UseCompressedOops, UseCompressedStrings
  4. 4. Packratting• Unintentionally storing data Unbounded caches • Classloaders • Containers / plugins ThreadLocals • Statics
  5. 5. What nowAvoid situation ;-)
  6. 6. Snapshot• -XX:+HeapDumpOnCtrlBreak -XX:+HeapDumpOnOutOfMemoryError jmap -dump:format=b,file=snapshot.bin pid• jconsole
  7. 7. MAT Eclipse Memory Analyzer Eclipse Memory Analyzer• Wizards Compare• Explore Query
  8. 8. Watch out• Can be large Takes time to produce• Can contain sensitive information
  9. 9. LInks MAT http://www.eclipse.org/mat/ jconsole http://docs.oracle.com/javase/7/docs/technotes/tools/share/jconsole.html jmap http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html jstat http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html• Java API http://www.eclipse.org/forums/index.php/t/243401/

×