What performance benefits does Oracle's commercial Hotspot JVM have over OpenJDK?

北慕城南 提交于 2019-12-24 04:51:28

问题


As described in this question:

OpenJDK vs Java HotspotVM

Oracle's commercial Hotspot JVM is essentially OpenJDK, plus several commercial-client-only features.

But - do these extra features actually contribute to performance on single machines and/or small clusters, with consumer-off-the-shelf hardware only? Or are they only relevant to large corporations with certain organizational needs and huge systems with custom hardware?

I'm specifically asking about "Java Flight Recorder, Application Class Data Sharing and Cooperative Memory Management" mentioned as the main commercial features in the linked-to question.


回答1:


Java Flight Recorder and Application Class Data Sharing have been open-sourced in the meantime, donated to the OpenJDK project.

Oracle plans to open-source all commercial-only features, or just remove them if nobody uses them. Mark Reinhold talks about this in this video from the JVM language summit just a few weeks ago https://youtu.be/15s5xP5BRxk?t=10m25s . He says:

In order to create a level playing field we've open-sourced all of [Apllication Class-Data Sharing, Java Flight Recorder, Java Mission Control, ZGC], these are now all open source. There's some remaining tiny, tiny commercial features that we will either open-source or we will just remove from the commercial offering because, well, it turns out not many customers are actually using them any way.

To quote the Oracle.com blog:

From Java 11 forward, therefore, Oracle JDK builds and OpenJDK builds will be essentially identical.

So if any of these commercial features gave any performance benefit, you can now get that benefit just by using OpenJDK as well.




回答2:


Java Flight Recorder and Mission Control are just tools for monitoring the JVM so will not directly impact its performance. They could have an indirect effect, as you can use the information generated by these tools to tune your JVM settings more effectively.

Co-operative memory management is designed to make the JVM play more nicely with other applications running on the same machine. If the OS starts to run low on free physical memory the JVM may reduce its resource utilisation, such as caches and heap space, to reduce the load on the system as a whole. The net effect of this might be to degrade the JVM performance.

Application Class Data Sharing is designed to improve the speed of starting the JVM with a given application by effectively caching class data structures that are generated by the JVM when it loads classes. You generate an archive file for your application, which is then mapped into memory by the JVM at launch eliminating a lot of JAR file reading. This mapped file can also be shared between multiple JVMs (running the same application) and reduce the footprint of each JVM instance.

As has already been stated, all these features have now been contributed to the OpenJDK project. As of JDK 11 (released next month), there will be no functional differences between the Oracle JDK and one built directly from the OpenJDK source code.



来源:https://stackoverflow.com/questions/51916267/what-performance-benefits-does-oracles-commercial-hotspot-jvm-have-over-openjdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!