Tuesday, May 10, 2011

Where are the differences between JVMs

•JRockit
•IBM JVM
•SUN JVM
•Open JDK
•Blackdown
•Kaffe

JVM implementations can differ in the way they implement JIT compiling, optimizations, garbage collection, platforms supported, version of Java supported, etc. They all must meet set of features and behaviors so that it will execute Java bytecodes correctly.

The major difference tends to be in licensing. Other non-technical differences tend to be in free/paid support options, integration with other technologies (usually J2EE servers), and access to source code.

Note, While a J2EE server runs on the JVM, some servers have integrated tools for monitoring, analyzing, and tweaking JVM performance.

As far as technical differences, those have grown less siginificant over the years. Once upon a time, the IBM and JRockit JVM's had far supierior performance to the reference Sun implementation. This was due to significant differences in the types of runtime optiizations, differences in garbage collection, and differences in native-code (and how much native code various classes uses). These performance differences aren't as significant anymore.

Some JVM's also include or integrate with diagnostics and monitoring tools. JRockit includes a set of tools for monitoring your JVM performance. Sun provides various JMX-based tools with overlapping features to do the same. IBM Websphere once upon a time included a similar set of tools for their whole J2EE application server, not sure if they still do.

Some of the open source JVM's tend to have a little slower performance because they have been redeveloped from the ground up. As such, they've got a bit more catching up to do. Some say Blackdown was significantly slower than the Sun JVM and was also a bit behind of supported versions of Java.

Why JRockit is More Recommended for Production Environments ?

- It Has More diagnostic tools than other JDKs such as JRA
- Management console with no overhead on performance (JRMC)…which is available inside \bin directory.
- Better performance on Intel architectures than other JVMs
- Higher memory usage for better performance
- Great code Optimization Stretegy. (Can be Disabled using -Xnoopt is you dont want optimization)

Oracle recommends that you use JRockit JDK with your Oracle products because it has a Enhanced Garbage Collection Strategies, It have a JRMC tool inbuilt to Monitor the JVM Activities in the Runtime with very less Burden on the Server/JVM.

There are some tools allowed you to know what is the JVM doing at runtime

jdb – the debugger
jps – the process status tool, which displays process information for current Java processes
javap – the class file disassembler
javah – the C header and stub generator, used to write native methods
extcheck – a utility which can detect JAR-file conflicts
apt – the annotation-processing tool [1]
jhat – (experimental) Java heap analysis tool
jstack – (experimental) utility which prints Java stack traces of Java threads
jstat – (experimental) Java Virtual Machine statistics monitoring tool
jstatd – (experimental) jstat daemon
jinfo – (experimental) This utility gets configuration information from a running Java process or crash dump.
jmap – (experimental) This utility outputs the memory map for Java and can print shared object memory maps or heap memory details of a given process or core dump.
idlj – the IDL-to-Java compiler. This utility generates Java bindings from a given Java IDL file.
VisualVM – visual tool integrating several command-line JDK tools and lightweight[clarification needed] performance and memory profiling capabilities
jrunscript – Java command-line script shell.

There is nice post about "Open the Black Box (JVM)" with tools from different JDK vendor.

References:

Difference between JVM implementations

Why and How Oracle JRockit?

Open the Black Box - Oracle JRockit, Sun Hotspot and IBM J9 JVM Tools

No comments:

´