3. 3
Important disclaimers
• THE INFORMATION CONTAINED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY.
• WHILST EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION
CONTAINED IN THIS PRESENTATION, IT IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED.
• ALL PERFORMANCE DATA INCLUDED IN THIS PRESENTATION HAVE BEEN GATHERED IN A CONTROLLED
ENVIRONMENT. YOUR OWN TEST RESULTS MAY VARY BASED ON HARDWARE, SOFTWARE OR
INFRASTRUCTURE DIFFERENCES.
• ALL DATA INCLUDED IN THIS PRESENTATION ARE MEANT TO BE USED ONLY AS A GUIDE.
• IN ADDITION, THE INFORMATION CONTAINED IN THIS PRESENTATION IS BASED ON IBM’S CURRENT
PRODUCT PLANS AND STRATEGY, WHICH ARE SUBJECT TO CHANGE BY IBM, WITHOUT NOTICE.
• IBM AND ITS AFFILIATED COMPANIES SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT
OF THE USE OF, OR OTHERWISE RELATED TO, THIS PRESENTATION OR ANY OTHER DOCUMENTATION.
• NOTHING CONTAINED IN THIS PRESENTATION IS INTENDED TO, OR SHALL HAVE THE EFFECT OF:
– CREATING ANY WARRANT OR REPRESENTATION FROM IBM, ITS AFFILIATED COMPANIES OR ITS
OR THEIR SUPPLIERS AND/OR LICENSORS
6. J9: Production JVM for ~18 years, still vibrant
• Java (SE) releases: Java 1.4.2, 5.0, 6, 6.1, 7, 7.1, 8, Java.next
• Some technology highlights :
– Cooperative suspend (1999)
– Diagnostic abilities: e.g. limit files, per method options (1999)
– Full optimization while supporting type accurate GC (1999)
– AOT (rom-able) compilation for Java (1999)
– Adaptive compilation (cold, warm, hot, very hot, scorching) (1999)
– Aggressive runtime native code patching (2000)
– Invocation and time-based compilation triggers (2000)
– JIT profiling infrastructure and optimizations (2001)
– Speculative class hierarchy based inlining and optimization (2001)
– Fairly complete set of classical compiler optimizations and dataflow analyses (2001)
– Java-specific optimizations like ”check” removal (2001)
– Java debug support (2001)
– Escape analysis and stack allocation (2001)
– Automatic lock coarsening (2002)
– Multiple code caches (2005)
– Real-time Specification for Java (AOT and JIT) (2005)
– Shared classes (2005)
– Asynchronous compilation (2006)
– Interpreter profiling (2006)
– Dynamic AOT compilation for Java (2006)
– Hot Code Replacement support (2007)
– Compressed references (2007)
– Multiple compilation threads (2010)
– On stack replacement (2013)
– Transactional Memory (2013)
– Packed objects (2013)
– Multitenancy (2013)
– Auto SIMD (2014)
– Auto GPU (2014)
– Heuristic tuning and retuning (1999– ongoing)
• Performance metrics that have been or are actively tracked :
– Latency (elapsed time)
– Throughput (operations / sec)
– Start-up time
– Ramp-up time
– CPU consumption
– Resource consumption at idle
– Compilation time
– Memory footprint
– JIT library size
– Incremental pauses
• Diagnostic facilities
– Direct Dump Reader, Snap files, verbose trace files, -Xtrace, -Xdump, …
– JIT logs, JIT limit files, per-method JIT option sets
– Core analyzer tool
– Health Center, GC Memory Visualizer, Memory Analysis tool, …
• Hardware platforms that are or have been supported :
– ME: ARM32, X86(IA32), MIPS, POWER, SH4
– 32-bit SE: ARM, POWER, X86, Z
– 64-bit SE: POWER, X86, Z
– Hard real-time (RTSJ compliant): IA32
• Hardware exploitation highlights:
– Efficient CPU instruction sequences
– Managing different kinds of hardware registers
– Exploiting hardware data type support
– Cryptographic, compression acceleration
– Character conversion loop recognition and acceleration
– Atomic locking and other synchronization optimization
– Simultaneous Multi Threading
– Transactional Memory
– SIMD (Single instruction multiple data)
– GPU (Graphics processing unit)
6
7. Production Runtime: J9 JVM
Calls to
C
libraries
7Operating system
Native
applications
OS-specific calls
Virtual machine
Garbage collector
Interpreter
Exception handler
Class loader
Pluggable components
that dynamically load
into the virtual machine
Thread model
JVM Profiler
Debugger
Port Library (file IO, sockets, memory allocation)
Uses one of many Java
platform configurations
JCL natives
JNIJava calls
JNI, INL, Fastcall
TR JIT
VM
Interface
Zip, fdlibm
Java VM
Classes
SE 8
SE 7
SE 6
SE 5
CDC
MIDP
CLDC
10. Eclipse OMR technology components
port platform abstraction (porting) library
thread cross platform pthread-like threading library
vm APIs to manage per-interpreter and per-thread contexts
gc garbage collection framework for managed heaps
compiler extensible compiler framework
jitbuilder WIP project to simplify bring up for a new JIT compiler
omrtrace library for publishing trace events for monitoring/diagnostics
omrsigcompat signal handling compatibility library
example demonstration code to show how a language runtime might
consume OMR components, also used for testing
fvtest language independent test framework built on the example glue so that
components can be tested outside of a language runtime,
uses Google Test 1.7 framework
+ a few others
~800KLOC at this point, more components coming!
10
18. OMR diagnostics
• DDRGen: builds a representation of internal VM data structures
• Read dwarf/debug output generated by compiler
• Also scrapes header files to learn about macros for, say, bit flags
• Still under development / refactoring from Java (jdmpview)
• Trace engine
• Similar to events, can define tracepoints with xml
• Can set verbosity so not all tracepoints are on by default (saves startup!)
• GC verbose logs
• Leverage event hooks to generate files readable by IBM Health Center and GC
Memory Visualizer tool
• JIT compiler logs, limit files, and option sets
• Detail logging output with numbered opts and transformations
• Can use command-line options to enable/disable numbered opts / transformations
• Limit files / options can only enable or exclude compiling certain methods
• Option sets can specify JIT diagnostic options for only certain methods 18
21. OMR Garbage Collector: omr/gc
• Highly parallel, scalable garbage collector
• Exploits multiple cores
• Balances work for multiple threads
• Rock solid automatic memory management for language runtimes
• Used for over a decade in the IBM J9 enterprise caliber Java Virtual Machine
• Mark/Sweep GC pause times (depends on live data set size):
• ~ 0.5 millisecond for small (2-4MB) heaps
• ~ 5 milliseconds for heaps at 10s of MBs
• Integrating Mark/Sweep GC to existing runtime should be <100 lines of code
• Can then add even more advanced capabilities incrementally
• Compaction
• Generational
• Concurrent
21
28. Proof point: Just in Time Compilers
• CRuby, CPython, SOM++ do not have JIT compilers
• Our efforts to date have high focus on compatibility:
• Compile native instructions for methods and blocks
• Avoid big changes to how existing runtimes work (ease adoption)
• Consistent behaviour for compiled code vs interpreted code
• No restrictions on native code used by extension modules: we can run Rails!
• No benchmark tuning or specials, no profile exploitation (yet)
• Recent focus has been 100% on open sourcing JIT
• Not on language ports
28
32. Interesting links and contact points
• Mark Stoodley mstoodle@ca.ibm.com @mstoodle
• Mailing List omr-dev@eclipse.org
• Sign up at https://dev.eclipse.org/mailman/listinfo/omr-dev
• Eclipse OMR Web Site https://www.eclipse.org/omr
• Eclipse OMR DeveloperWorks Open site https://developer.ibm.com/open/omr/
• Eclipse OMR Github project https://github.com/eclipse/omr
• IBM SDK for Java Docker images
https://hub.docker.com/r/ibmcom/ibmjava/
• Ruby+OMR Technology Preview Github project with Docker images for Linux on LinuxONE,
OpenPOWER, and X86
https://github.com/rubyomr-preview/rubyomr-preview
• SOM++ with OMR GC and JitBuilder
https://github.com/charliegracie/SOMpp/tree/OSCON2016 32