

Sed 's/Xmx512/Xmx4096/g' MemoryAnalyzer.ini You to open big heapdump, to increase it go to app location andĬd /Applications/mat.app/Contents/Eclipse Normally the default heap size of MAT (512Mb) will not help.Its feature, and below is some of my personal notes about the usage, So that’s all, I think MAT UX is simple enough for you to explore The most memory of the entire heap (so the name “dominator” says it all). We need to know “what point to those strings”, and why it keeps thoseĭominator tree : We know that heap = graph that we talked about.ĭominitor tree is a part of the graph which stand alone and consumes You say that, I have 10G heap contains strings, it’s just meaningless. The retained heap is just more important, because when Retained heap : Shallow heap + lifetime-dependenct outgoing Shallow heap : the heap of object and its primitive itself.Graph easier, and find the part of the graph which is consumingīig portion of memory. So basically MAT is a visualize tool help us traverse the heap Reason they use incoming and outgoing because children could Outgoing references can be thought as “children”.Incoming references can be thought as “parents”.Ref may heave primitives (integers, longs, bytes.). MAT will analyze java heap only, it doesn’t care about the native heapīasically Java heap is directed graph (digraph) of references. MAT mechanism It’s all about graph traverse Using jmap to generate heap dump from core file (see document).jmap is pretty cool huh.So in short, jmap just not works in my case, it will just crashed with weird error like: : field "_bmStartWord" not found in type CMSBitMap Eventually, frequent FullGC hangs Java application because Java application cannot free objects due to STW. The graph shows that in the viewpoint of JVM, application required much java heap size over than Xmx somehow, so JVM attempts to create Java heap space by Full GC as last resort, but there were not freed objects. Here is the GC graph for the case (memory leakĬause hang application) if you’re interested in: Interestingly in my case my app didn’t OOM but just hang and fullGC You download the heapdump to local and open it with MAT.Or using bundle Hotspot tool like jmap or jconsole) You take a heap dump (using -XX:HeapDumpOnOutOfMemoryError option,.MAT usage is pretty straight forward so I didn’t try to cover details If you think GC language like Java should “never” Recently I met memory leak in on of myĪpplication. MAT is one of most useful tool to analyze Java (or any JVM
