Tuesday, May 12, 2009

Java Heap Analysis Using Jhat after OOM

OutOfMemory in Java: Sometimes garbage Collector can't collect everything and JVM cries ..

Using jmap and jhat to get heap dump and analyze dump.

http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/memleaks.html

Check here how to query the heap

If your heap dump size of 2GB+ you may not be able to run jhat server on machine with less memory. In that case try and use amazon ec2 instance.