java JVM 实现之间的差异
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/747360/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Differences between JVM implementations
提问by Martin K.
Where do JVM Implementations differ (except licensing)? Does every JVM implement Type Erasure for the Generic handling?
JVM 实现有何不同(许可除外)?是否每个 JVM 都为泛型处理实现了类型擦除?
Where are the differences between:
区别在哪里:
- JRockit
- IBM JVM
- SUN JVM
- Open JDK
- Blackdown
- Kaffe
- JRockit
- IBM JVM
- 太阳虚拟机
- 打开 JDK
- 黑化
- 咖啡
..... Deals one of them with Tail-Call-Optimization?
..... 用尾调用优化处理其中之一?
采纳答案by James Schek
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.
JVM 实现在实现 JIT 编译、优化、垃圾收集、支持的平台、支持的 Java 版本等方面可能有所不同。它们都必须满足一组特性和行为,以便正确执行您的 Java 字节码。
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.
正如您所指出的,主要区别往往在于许可。其他非技术差异往往在于免费/付费支持选项、与其他技术(通常是 J2EE 服务器)的集成以及对源代码的访问。
Note: While a J2EE server runs on the JVM, some servers have integrated tools for monitoring, analyzing, and tweaking JVM performance.
注意:虽然 J2EE 服务器在 JVM 上运行,但一些服务器已经集成了用于监控、分析和调整 JVM 性能的工具。
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.
就技术差异而言,这些年来已经变得不那么重要了。曾几何时,IBM 和 JRockit JVM 的性能远远优于参考 Sun 实现。这是由于运行时优化类型的显着差异、垃圾收集的差异和本机代码的差异(以及各种类使用多少本机代码)。这些性能差异不再那么显着。
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)...
一些 JVM 还包括或集成了诊断和监控工具。JRockit 包含一组用于监控 JVM 性能的工具。Sun 提供了各种具有重叠功能的基于 JMX 的工具来完成相同的工作。曾几何时,IBM Websphere 为他们的整个 J2EE 应用服务器包含了一组类似的工具(不确定他们是否仍然这样做,但我认为这仍然是正确的)......
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.
一些开源 JVM 的性能往往会稍慢一些,因为它们是从头开始重新开发的。因此,他们还有更多的工作要做。大约 2 年前我检查过,Blackdown 比 Sun JVM 慢得多(1.5x-2x?)。它也落后于受支持的 Java 版本。
回答by Brian Agnew
Type erasure is a compiler functionand as such JVM independent.
类型擦除是一个编译器功能,因此与 JVM 无关。
回答by John Smith
JIT compiling is one thing that some JVM:s don't have.
JIT 编译是某些 JVM 没有的一件事。
回答by Zifre
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.
诸如类型擦除之类的事情由编译器完成,以便与旧的 JVM 向后兼容。大多数 JVM 应该支持您需要的所有功能,但有些可能比其他更优化。我猜 Sun JVM 可能是最快的。
回答by Thorbj?rn Ravn Andersen
If the JVM claims to be Java it must pass the TCK, providing a lot of stock funcitonaltiy.
如果JVM声称是Java,它必须通过TCK,提供大量的库存功能。
The differences are in non-core places, like garbage collection, the jconsole/visualvm in the Sun JVM, precompilation etc.
不同之处在于非核心的地方,比如垃圾收集、Sun JVM 中的 jconsole/visualvm、预编译等。
clarification: TCK is the test suite that a virtual machine has to pass in order to be officially Java compliant.
说明:TCK 是虚拟机必须通过的测试套件,才能正式符合 Java 标准。
回答by erickson
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 issuesinvolved.
Java 尚不支持尾调用优化。John Rose 正在领导将其包含在未来版本中的工作,并描述了该方法以及所涉及的一些问题。
回答by Jin Kim
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.)
JVM 之间的另一个区别是对未记录 API 的行为。(例如 com.sun.xxx) 例如,Sun 的 JVM 和 IBM 的 JVM 在信号处理方面的行为略有不同。(IBM 的 JVM 在某些情况下不允许应用程序捕获“INT”信号。)
回答by Mohammad Imran
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.
JVM 就像一个虚拟机,负责加载类和字节码变量,执行代码。而 Applocaion 编程接口是包的集合。和包是类的集合。Java 程序在 JVM 安装和工作的地方执行。

