Pages

Monday, May 13, 2013

JRocket vs. SUN JDK

 SUN JDK
JRocket
Uses Interpreter
Interpreter interprets (executes) one line at a time from the source file. Such as PHP, Perl, other scripting languages
The byte code is read and the translated into machine language, but these results are not saved in the memory. So every time even if the same method is run again and again, the JVM has to translate the code into machine language. This means machine code will not be reusable as it is not saved anywhere in the memory.
Due to this mechanism the server startup is fast because it will not save the machine code in memory
Uses JIT Compiler
Compiler transforms one language into another. For example, C# into IL, Java into byte code, C++ into binary machine code. No execution happens at the compilation stage.
Once a method is run, the byte code is translated to machine language and this is saved in the memory. This means if the method is run again, there is no need for translation and the machine code is reused.
In this case the server will take a little more time since the machine code needs to be saved inside the memory. but we get a better performance when the application running since the machine instructions are already saved in memory and no need to re compile them again.
JIT is also used by Sun JDK, but that was in the earlier versions.
Also Uses a Hotspot mechanism by which it finds methods that are very often used and optimizes them for better performance.
Many Issues are seen during this phase, options are available for disabling these.
SUN JDK has many memory spaces like Eden, Permanent ,Survivor spaces where objects move between them
JRocket has just Young and Old Spaces. No Permanent Spaces.
The JRockit Native memory space is storing the Java Classes metadata, Threads and objects such as library files, other JVM and third party native code objects.
SUN JDK has no such facilities
JRocket has self tuning system , in cases such as Out Of Memory due to native TLA due to insufficient TLA which is 2kb in size, it takes case of such things by auto tuning these settings if the application needs
During Crash , SUN JDK generates hr_err.pid file
Generates dump file which contains the reason for the crash

JRocket has tools to analyze the JVM performance with low over head.