Post on 01-Nov-2014
description
Out Of MemoryOut Of MemoryAnalyze Your Java HeapAnalyze Your Java Heap
GC silver bullet
Unreferenced memory cleared
Fragmentation cleanup
Incorrect understanding of data / structures
Packratting
Data / Structures
Primitives vs Objects
Byte vs byte
Overhead of structure
LinkedList vs ArrayList
JVM settings
UseCompressedOops, UseCompressedStrings
Packratting
Unintentionally storing data
Unbounded caches
Classloaders
Containers / plugins
ThreadLocals
Statics
What now
Avoid situation ;-)
Snapshot
-XX:+HeapDumpOnCtrlBreak
-XX:+HeapDumpOnOutOfMemoryError
jmap -dump:format=b,file=snapshot.bin pid
jconsole
MATEclipse Memory Analyzer
Wizards
Compare
Explore
Query
Can be large
Takes time to produce
Can contain sensitive information
Watch out
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/