OpenJDK vs Java HotspotVM

arvist picture arvist · Jun 2, 2017 · Viewed 12.2k times · Source

Are OpenJDK VM and Oracle Hotspot VM still two different JVMs?

I can't seem to find any somewhat official documentation on anything about OpenJDK VM. Even in OpenJDK homepage there is an HotSpot Group which develops HotSpot VM.

The HotSpot group is comprised of developers involved in the design, implementation, and maintanence of the HotSpot virtual machine

However if I check java -version on my Windows machine it prints out

Java HotSpot(TM) 64-Bit Server VM

But on my Ubuntu VPS

OpenJDK 64-Bit Server VM

If those are two different VMs what are the main differences between them? Do they have different runtime flag sets?

Answer

Basil Bourque picture Basil Bourque · May 22, 2019

tl;dr

The accepted Answer by apangin is now outdated.

For recent versions such as Java 11, the Oracle JDK product is virtually identical to the OpenJDK project. OpenJDK now includes Oracle's previous offerings: Java Flight Recorder, Java Mission Control, Application Class-Data Sharing, and ZGC.

To quote the Oracle.com blog:

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

Oracle JDK & OpenJDK converging

Oracle has made dramatic changes in the last couple years.

Oracle declared their intention to converge their branded Oracle JDK with OpenJDK to feature-parity. Both are based on the OpenJDK code base.

Towards that end, the formerly commercial tools sold by Oracle, Flight Recorder and Mission Control are now open-sourced and donated to the OpenJDK project. See this and this on the OpenJDK site.

Oracle and other members of the OpenJDK consortium have contributed yet more source code to make the OpenJDK code base entirely open-source and unencumbered by licenses other than the GNU GPL+linking exception.

Oracle has changed their licensing terms. The Oracle JDK branded product is no longer free-of-cost for use in production. Alternatively, you can get a free-of-cost distribution of OpenJDK from any of over half a dozen vendors, including one from Oracle. For all the details, see this vital white paper written by pillars of the Java community, Java Is Still Free.

I drew this flowchart to guide you in selecting a JDK source.

Flowchart guiding you in choosing a vendor for a Java 11 implementation

Oracle reserves the right to patch their own branded product for an urgent fix or security vulnerability. But the company has stated their intention to also contribute and coordinate with the other OpenJDK members. Oracle continues to own the Java trademarks and to lead the future of the Java platform. For the existing Long-Term Support (LTS) versions 8 and 11, Oracle has ceded stewardship to RedHat (IBM).

Motivations in choosing a vendor for Java

HotSpot versus OpenJ9

The Question here asks:

Are OpenJDK VM and Oracle Hotspot VM still two different JVMs?

As discussed above, the two products are converging at feature parity. Regarding HotSpot technology, read on.

HotSpot is one component within both Oracle JDK and OpenJDK, as discussed above. Today’s HotSpot also combines parts from JRockit. Oracle merged the best of both Java engines, having acquired them from Sun Microsystems and BEA Systems.

The Adoptium project (formerly known as AdoptOpenJDK) from the Eclipse Foundation also provides a build of OpenJDK using Eclipse OpenJ9 (based on J9, donated by IBM) as an alternative to HotSpot. When downloading from Adoptium web site, you choose either HotSpot or OpenJ9 from a menu.

Currently, tests seem to show OpenJ9 as dramatically faster to launch while using much less memory, but HotSpot may run faster with sustained usage. But this is still early days for OpenJ9, so investigate for yourself the latest developments.

Diagram showing history of HotSpot & JRockit merging, and OpenJ9 both available in Adoptium