Differences between JVM implementations
Asked Answered
K

8

20

Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling?

Where are the differences between:

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

..... Deals one of them with Tail-Call-Optimization?

Kirovograd answered 14/4, 2009 at 12:42 Comment(0)
B
19

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 your Java bytecodes correctly.

As you've pointed out, 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 significant over the years. Once upon a time, the IBM and JRockit JVM's had far superior performance to the reference Sun implementation. This was due to significant differences in the types of runtime optimizations, 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, but I would assume that's still true)...

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. Last I checked about 2 years ago, Blackdown was significantly slower (1.5x-2x?) than the Sun JVM. It was also a bit behind of supported versions of Java.

Blandina answered 14/4, 2009 at 14:24 Comment(2)
As someone forced to used JRockit for over 5 years now, I would say that overall it is no faster than Hotspot, but it's definitely not as robust. They sacrifice reliability for speed, and end up with nothing.Eureka
@erickson, As someone who has voluntarily used JRockit for over 5 years now, I can say that your experiences aren't universal. JRockit has saved at least once with its memory leak detection tool as well. :) I haven't had any more crashes with it than with Sun VMs (though there have been 1 or two).Notate
S
12

Type erasure is a compiler function and as such JVM independent.

Sulphurate answered 14/4, 2009 at 12:48 Comment(0)
M
1

JIT compiling is one thing that some JVM:s don't have.

Martial answered 14/4, 2009 at 12:50 Comment(6)
What's about the sun JVM? java.sun.com/javase/technologies/hotspot It seems, the hotspot JIT compiler is sipped with every JVM release!Kirovograd
I'm not sure what you want to say there, but yes, Hotspot is a part of Sun JVM.Martial
Why do you say there that evey JVM doesn't have JIT compiling when it's part of the most JVMs? Why do you vote me down?Kirovograd
@abababa22: "every JVM doesn't have" is pretty much equivalent to "no JVM has", at least in U.S. English. Did you mean "not every JVM has"?Wirehaired
@mmyuers: I think thats exactly what he meant. There are a few like that for special purposes.Notate
@mmyers: I meant "not every JVM has" of course. I'm not a native speaker.Martial
M
1

Things like type erasure are done by the compiler to be backward compatible with older JVMs. Most JVMs should support all the features you need, but some may be more optimized than others. I'm guessing the Sun JVM is probably the fastest.

Mahau answered 14/4, 2009 at 12:51 Comment(0)
W
1

If the JVM claims to be Java it must pass the TCK, providing a lot of stock funcitonaltiy.

The differences are in non-core places, like garbage collection, the jconsole/visualvm in the Sun JVM, precompilation etc.


clarification: TCK is the test suite that a virtual machine has to pass in order to be officially Java compliant.

Wellestablished answered 14/4, 2009 at 13:14 Comment(0)
E
1

Tail-call optimization is not yet supported by Java. John Rose is leading efforts to include this in a future release, and has described the approach, and some of the issues involved.

Eureka answered 14/4, 2009 at 15:49 Comment(3)
I remember on options for Java6 (experimental features), maybe the Sun JDK supports it as experimental? What's about the "Da vinchi VM" I heard it should support TCO!Kirovograd
Yes, the da Vinci project is geared toward support for other languages, and that is where support is being prototyped.Eureka
Some sort of this optimization (tail-recursion only) is supported by IBM JVM (something like a goto to the beggining of the method)Prudhoe
A
1

Another difference between JVMs is behaviour on undocumented API. (e.g. com.sun.xxx) For example, Sun's JVM and IBM's JVM both have slightly different behaviour on signal handling. (IBM's JVM doesn't allow the application to trap the "INT" signal in certain cases.)

Alvertaalves answered 6/8, 2009 at 15:0 Comment(0)
T
1

JVM is like a virtual Machine that works to Load the class and Bytcode varifier, execute the code. while Applocaion Programming Interface is Collection of Packages. and Packages are collection of class. Java program execute where JVM Installed and Works.

Triumph answered 14/5, 2010 at 10:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.