Javaforum looking into the memory

  • Published on
    01-Nov-2014

  • View
    1.456

  • Download
    2

Embed Size (px)

DESCRIPTION

Out Of Memory - Analyze Your Java HeapA 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

Transcript

<ul><li> 1. Out Of Memory Analyze Your Java Heap </li> <li> 2. GC silver bullet Unreferenced memory cleared Fragmentation cleanup Incorrect understanding of data / structures Packratting </li> <li> 3. Data / Structures Primitives vs Objects Byte vs byte Overhead of structure LinkedList vs ArrayList JVM settings UseCompressedOops, UseCompressedStrings </li> <li> 4. Packratting Unintentionally storing data Unbounded caches Classloaders Containers / plugins ThreadLocals Statics </li> <li> 5. What nowAvoid situation ;-) </li> <li> 6. Snapshot -XX:+HeapDumpOnCtrlBreak -XX:+HeapDumpOnOutOfMemoryError jmap -dump:format=b,file=snapshot.bin pid jconsole </li> <li> 7. MAT Eclipse Memory Analyzer Eclipse Memory Analyzer Wizards Compare Explore Query </li> <li> 8. Watch out Can be large Takes time to produce Can contain sensitive information </li> <li> 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/ </li> </ul>