Javaforum looking into the memory

  • Published on

  • View

  • Download

Embed Size (px)


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


<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 jconsole jmap jstat Java API </li> </ul>