Eclipse Open J9 – an Open Source Java Virtual Machine Based on the Eclipse OMR Project

03-01 16:16

IBM has been working hard on their own flavor of the Java Virtual Machine (JVM) -- J9 JVM -- since 1997. J9 was built as a closed source (proprietary) independent implementation of the JVM whose class libraries were based on the licensed Sun (now OpenJDK) implementation. J9 has many enhancements and flag-bearing optimizations including: tiered compilation; shared classes; escape analysis; hardware specific optimizations, such as selecting the correct large page size; soft real-time garbage collector; API optimizations via Apache Harmony, dynamic ahead-of-time (AOT) compilation; several object locking specific optimizations; and more.

Since version 5, IBM's J9 JVM has been offered in IBM's Java Development Kits (JDKs). For Windows platform, the JDK is bundled and shipped with IBM's Websphere Application Server (WAS). For Linux, AIX, z/OS and IBM I platforms, the JDK (also known as SDK, where S stands for Software) and the corresponding Java Runtime Engine (JRE) can be downloaded from IBM DeveloperWorks'; Downloads' page, and also pulled from DockerHub at . Form factors include SDK, JRE, small footprint Java (sfj) or alpine.

The Eclipse OMR Project

In early 2016, IBM open sourced the core, non-Java parts of the J9 runtime environment under the Eclipse OMR project . The OMR project is a language-agnostic runtime toolkit. More details on the Eclipse OMR project can be found in this presentation by Dr. Mark Stoodley, OMR project co-lead:

Below are a few slides from the above presentation that give an overview of the OMR project.

For Java, the language runtime could be shown as below:

If we had to show a similar runtime for Ruby, it would look as shown in this slide:

If we substitute Ruby for Python, the runtime environment blocks would be identical to Ruby. This made it clear to IBM that they could organize the J9 runtime into layers for core runtime components as shown in the slide below:

Accordingly, the OMR project could be constructed as a collection of language agnostic runtime technology components that can be used to build runtimes for Java, Ruby, Python, and other languages.

The OMR project has the following components:

  • A garbage collection framework for managed runtime heaps. This includes the mark-sweep, the generational and the parallel scavenge garbage collectors (GCs)
  • A virtual machine API to manage per interpreter and thread contexts
  • A compiler for native code generation
  • Diagnostic services aka “Health Center” to help with live analysis of GC and other runtime details as well as method profiling abilities
    • A trace library helps provide communication with the monitoring tools
  • Few libraries such as port, thread and util to provide platform abstraction and cross platform runtime abilities. There is also a library for signal handling.

IBM engineers have built runtimes and JIT compilers for the following languages, based on OMR components:

Ruby, Python, SOM++ (Smalltalk), a Lua JIT called Lua Vermelha, a JIT for the Rosie Pattern Language, a partial JIT for Swift, as well as tutorial JITs and runtimes for Base9 (a simple Javascript like runtime) and Kaleidoscope, the tutorial language used by the LLVM project. This is, of course, in addition to building their own production SDK for Java 8 from the OMR project.

More information on the Eclipse OMR project can be found here:

The Eclipse OpenJ9 Project

This article started with a brief overview of IBM’s J9 JVM, and until 2016/7 J9 was closed source. Since then it has been moved to the Eclipse Foundation as an openly governed open source project, and renamed to OpenJ9. IBM saw the impact of the open source community and as J9 is a central component within IBM’s Java offerings, they aspired to encourage development within the open, and ultimately to engage with the larger open source community. From September 2017 the Eclipse OpenJ9 has been an open source project within which IBM and others work together on the J9 JVM.

OpenJ9 consumes Eclipse OMR and itself fits into the Java class libraries from OpenJDK 9 and future releases, as shown in the next two slides from a presentation made by Dr. Stoodley @JavaOne 2017:

More information on OpenJDK with OpenJ9 can be found in the above presentation. A few useful links are listed here:

OpenJ9 with OpenJDK 8

The ability to download, build and run OpenJ9 with OpenJDK 9 was a great achievement for the Eclipse OpenJ9 project. However, because Java 9 is not a long term supported (LTS) release, many developers are still using Java 8, and it became clear that there needed to be a port of OpenJ9 for OpenJDK 8.

In November 2017, just two short months after becoming an open source project, Eclipse OpenJ9 announced that OpenJDK 8 could be built with OpenJ9 ( ) and also announced the availability of downloadable binaries at the AdoptOpenJDK project:

According to the Eclipse OpenJ9 for Java 8 article, "the Eclipse Open J9 project uses a single code stream to implement the JVM across all supported Java releases, from Java 8 to Java 9 and beyond." Through this single stream development model Eclipse OpenJ9 aims, as much as possible, to provide JVM technology advancements for all currently supported JDK levels at the same time. Of course, some JVM enhancements are tied to language-level changes that are purposefully targeted at major Java release boundaries, and Eclipse OpenJ9 will respect those choices so that programmers can continue to rely on the solid Java platform that they know and love.

The above article also points users to the OpenJ9 performance page which has DayTrader 3 application benchmark test results comparing OpenJDK 9 with OpenJ9 to OpenJDK 9 with HotSpot VM.

A quick look at those charts highlights the benefits of shared classes and ahead-of-time (AOT) compilation strategy in reducing startup times for large applications running on the OpenJ9 JVM, as shown in this graph from the article:

The article also notes that OpenJ9 consumes only half the memory footprint of OpenJDK with Hotspot, even when load is applied to the system, while providing equivalent performance. As cloud and Platform as a Service (PaaS) deployments are typically priced by the megabyte per time unit, running in half the memory footprint could potentially save significant amounts of money for certain use cases.

标签: Eclipse Java 开源
© 2014 TuiCode, Inc.