venerdì 7 settembre 2012

First Aid of JVM Crash Issues

Java Virtual Machine is a Native engine which allows our Java Applications to run. 
It performs the code optimization to improve the performance. 
In correct tuning, Low memory allocation, extensive code optimization, bad garbage collection strategy, API code leaking…etc are some of the reasons which may cause the JVM to crash.
Analyzing a JVM Crash is one of the very interesting and little time taking process sometimes it is even little complex to find out the root cause of the JVM Crash. 
Here in this article we will see some of the common mistakes, first aid solutions/debugging techniques to find out what kind of informations we can get by looking into the Core Dump.

What is Core Dump & Where to Find It?

Code dump is usually a Binary file which gets generated by the Operating System when JVM or any other process crashes. 
Sometimes it also happens that the JVM will not be able to generate the Crash dump. 
In Windows Operating Systems it will be generated in the Directory where the “Dr. Watson” tool is installed. 
In Windows it will be usually:  
C:\Documents and Settings\All Users\Application Data\Microsoft\Dr Watson

By default in Unix based Operating Systems the Core Dump files are created in the directory where the Java Program/Server was started even sometimes it is generated in the “/tmp” directory of the Operating System. 
But using the following Java Option we can change it’s the Crash Dump/Heap   Dump generation locations:  -XX:HeapDumpPath=/opt/app/someLocaton/ and  -XX:+HeapDump JVM Options.

NOTE: These Flags does not gurantee that always the Heap/Crash dump will be generated at the time of JVM Crash. There are some more reasons behind the Core Dump not gets generated…like Process Limitations or the Less Disk Quota or unavailability of the Free File Descriptors.



Nessun commento:

Posta un commento