SlideShare una empresa de Scribd logo
1 de 59
Descargar para leer sin conexión
Dan Heidinga,
OpenJ9 Project Lead
IBM Runtimes J9 Interpreter Lead
Daniel_Heidinga@ca.ibm.com
@DanHeidinga
Oct 3, 2017
OpenJ9: Under the Hood of the
Next Open Source JVM
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
2
Who am I?
§ I've been involved with virtual machine development at IBM
since 2007 and am now the J9 Virtual Machine Team Lead.
J9 is IBM's independent implementation of the JVM.
§ I've represented IBM on both the JSR 292 ('invokedynamic')
and JSR 335 ('lambda') expert groups and lead J9's
implementation of both JSRs.
§ I’ve also maintain the bytecode verifier and deal with various
other parts of the runtime.
§ Now one of the Project Leads for the Eclipse OpenJ9 JVM.
3
Dan Heidinga,
OpenJ9 Project Lead
IBM Runtimes J9 Interpreter Lead
Daniel_Heidinga@ca.ibm.com
@DanHeidinga
Oct 3, 2017
Eclipse
OpenJ9: Under the Hood of the
Next Open Source JVM
http://www.eclipse.org/openj9
https://github.com/eclipse/openj9
Dual License:
Eclipse Public License v2.0
Apache 2.0
Users and contributors very welcome
https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md
Eclipse OpenJ9
Created Sept 2017
https://adoptopenjdk.net/nightly.html?variant=openjdk9-openj9
$ git clone https://github.com/ibmruntimes/openj9-openjdk-jdk9
$ cd openj9-openjdk-jdk9
$ bash ./get_source.sh
$ bash ./configure --with-freemarker-jar=freemarker.jar
$ make images
$ cd build/linux-x86_64-normal-server-release/images/
$ ./jdk/bin/java -version
7
Building OpenJDK with OpenJ9
Wait… OpenJDK with OpenJ9?
8
9
10 http://docs.oracle.com/javase/8/docs/index.html
11
The VM has connections into the rest of the JDK
12
OpenJDK with Eclipse OpenJ9
To build OpenJDK with OpenJ9 requires patches
• Build process
• Class libraries
OpenJ9 Communities
Open	
JDK
HotSpot
Eclipse	OMR
Open	
JDK
Eclipse	
OpenJ9
Eclipse	
OMR
Proven	adaptable	technology	in	the	
open	for	rapid	innovation	and	
collaboration	across	multiple	
language	communities
OpenJDK IBM	SDK	for	Java
Java	community	open	innovation	
and	collaboration
Ruby?
OMR
Communities	Beyond	Java
COBOL
PL/I
Emulator
Python?
OMR
JS?
OMR
Swift?
OMR
…
Long	term	support,	quick	
response	for	problems,	and	
other	forms	of	IBM	customer	
specific	engagement
+
IBM
isms
Open	
JDK
Eclipse	
OpenJ9
Eclipse	
OMR
Build an open reusable language runtime foundation for cloud platforms
– To accelerate advancement and innovation
– In full cooperation with existing language communities
– Engaging a diverse community of people interested in language runtimes
• Professional developers
• Researchers
• Students
• Hobbyists
Eclipse OMR Mission
http://www.eclipse.org/omr
https://github.com/eclipse/omr
https://developer.ibm.com/open/omr/
Dual License:
Eclipse Public License v2.0
Apache 2.0
Users and contributors very welcome
https://github.com/eclipse/omr/blob/master/CONTRIBUTING.md
Eclipse OMR
Created March 2016
public class HelloService {
public static void main(…) {
System.out.println(“Hello”);
}
}
17
$ java -jar uber.jar
18
$ java -jar uber.jar
19
Hello
$
20
What’s a JVM
actually doing
here?
21
22
Classfile
23
Classfile
Inputs Outputs
24
Classfile
Inputs Outputs
$ java -jar uber.jar
25
Hello
$
$ java –verbose:class
-jar uber.jar
26
27
…
class load: jdk/internal/org/objectweb/asm/FieldVisitor from: jrt:/java.base
class load: jdk/internal/org/objectweb/asm/FieldWriter from: jrt:/java.base
class load: java/lang/ClassLoader$$Lambda$3/00000000702E91F0
class load: HelloService from: file:/openj9/uber.jar
class load: jdk/internal/reflect/UnsafeFieldAccessorFactory from: jrt:/java.base
class load: jdk/internal/reflect/FieldAccessor from: jrt:/java.base
class load: jdk/internal/reflect/FieldAccessorImpl from: jrt:/java.base
class load: jdk/internal/reflect/UnsafeFieldAccessorImpl from: jrt:/java.base
class load: jdk/internal/reflect/UnsafeObjectFieldAccessorImpl from: jrt:/java.base
class load: java/lang/Class$ReflectCache from: jrt:/java.base
class load: java/lang/annotation/Annotation from: jrt:/java.base
class load: jdk/internal/reflect/CallerSensitive from: jrt:/java.base
….
“Data dominates.
If you've chosen the right data structures and
organized things well, the algorithms will almost
always be self-evident.
Data structures, not algorithms, are central to
programming.”
–Rob Pike (known for Plan 9, UTF-8, Go)
28
29
public class HelloService {
public static void main(…) {
System.out.println(“Hello”);
}
}
30
What does the JVM do to find that main method?
31
J9ROMClass: a better classfile
§ Keep all the symbolic info from a classfile
§ Remove variability (where possible)
§ Position independent: map anywhere in the address space
§ ROM: Read only once written
– Learn from the Smalltalk past
32
ROMClass
Conversion to ROM
33
Classfile Static
Verification
ROMClassROM Class
Builder
https://github.com/eclipse/openj9/tree/master/runtime/bcverify
https://github.com/eclipse/openj9/tree/master/runtime/bcutil
Regular pointers
34
0x50
0x20
0x28
0x30
0x38
0x40
0x48
0x50
0x58
0x60
Self-relative pointers
35
0x20
0x20
0x28
0x30
0x38
0x40
0x48
0x50
0x58
0x60
0x30 + *(0x30) = 0x30 + 0x20 = 0x50
Address of slot + value = target address
typedef struct J9ROMClass {
U_32 romSize;
U_32 singleScalarStaticCount;
J9SRP className;
J9SRP superclassName;
U_32 modifiers;
U_32 extraModifiers;
U_32 interfaceCount;
J9SRP interfaces;
U_32 romMethodCount;
J9SRP romMethods;
U_32 romFieldCount;
J9SRP romFields;
U_32 objectStaticCount;
U_32 doubleScalarStaticCount;
U_32 ramConstantPoolCount;
U_32 romConstantPoolCount;
...
} J9ROMClass;
J9ROMClass
ROM
Constant pool
interfaces
J9ROMMethods
. . .
37
public static void main(java.lang.String[])
0 JBgetstatic 2 System.out LPrintStream;
3 JBldc 3 (java.lang.String) "Hello”
5 JBinvokevirtual 4 PrintStream.println(LString;)V
8 JBreturn
Java’s late bound… Isn’t it slow to resolve
the fields / methods every time?
From ROM to RAM
38
RAM class creation
Load superclases
Load superinterfaces
Calculate vtable
ROMClass J9RAMClass
https://github.com/eclipse/openj9/blob/master/runtime/vm/createramclass.cpp
typedef struct J9Class {
UDATA eyecatcher;
struct J9ROMClass* romClass;
struct J9Class** superclasses;
UDATA classDepthAndFlags;
struct J9ClassLoader* classLoader;
j9object_t classObject;
UDATA volatile initializeStatus;
struct J9Method* ramMethods;
UDATA* ramStatics;
struct J9Class* arrayClass;
UDATA totalInstanceSize;
UDATA* instanceDescription;
UDATA packageID;
void** iTable;
void** jniIDs;
struct J9Class* replacedClass;
UDATA* ramConstantPool;
. . .
} J9Class;
J9Class
VTable
JIT VTable RAM
Constant pool
J9Methods
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
ShareClasses: ROM pays off
JVM 1 JVM 2 JVM 3
Shared Classes
Cache
Faster startup, Smaller footprint
43
ROMClass J9RAMClass
Cool native memory!
How does this show
up for my Java code?
Classloading: tying it all together
44
ROMClass J9RAMClass
J9ClassLoader
java.lang.Class java.lang.ClassLoader
Heap
Native
45
public static void main(java.lang.String[])
0 JBgetstatic 2 System.out LPrintStream;
3 JBldc 3 (java.lang.String) "Hello”
5 JBinvokevirtual 4 PrintStream.println(LString;)V
8 JBreturn
That’s all good but what about actually
running my code???
Execution context: the Thread
46
J9VMThreadJ9VMThreadJ9JavaVM
omrthread_t omrthread_t omrthread_t
Heap
Native
java.lang.Thread java.lang.Thread java.lang.Thread
SP
A0
PC
Method
Per-Thread Interpreter State
47
J9VMThread
omrthread_t
java.lang.Thread
J9Method
ROMMethod
Bytecodes
SP
A0
PC
Method
Per-Thread Interpreter State
48
J9VMThread
omrthread_t
java.lang.Thread
J9Method
ROMMethod
Bytecodes
SP
A0
PC
Method
Per-Thread Interpreter State
49
J9VMThread
omrthread_t
java.lang.Thread
Pending
Frame
Temps
Args
Java stack
J9Method
ROMMethod
Bytecodes
0
Interpreter
§ Written in C++
§ Switch statement / computed goto
§ Executes:
– bytecodes
– INLs
– builds stack frames
§ Transition to the JIT
50
https://github.com/eclipse/openj9/blob/master/runtime/vm/BytecodeInterpreter.hpp
JIT Compilation
ARM
Optimizer
Analyses	and	Optimizations
cold warm hot FSDscorching AOT
IL	Generation
x86
POWER
Z
Code	Generators
Runtime
Environment/
Configuration
•Options
•Object	Model
•Memory
•Threading
•Tracing
codeMetadataRuntimeRT Helpers
very hot profiling
Profile
Manager
Hardware
counters
Sampling
Thread
Interpreter
Profile Info
JIT
Profile Info
Profiler
Adaptive JIT Compilation
52
§ Methods start out running bytecode form directly
§ After many invocations (or via sampling) code get compiled at
‘cold’ or ‘warm’ level
§ Low overhead sampling thread is used to identify hot methods
§ Methods may get recompiled at ‘hot’ or ‘scorching’ levels (for more
optimizations)
§ Transition to ‘scorching’ goes through a temporary profiling step
cold
hot
scorching
profiling
interpreter
warm
53
+ (cold) jdk/internal/reflect/NativeConstructorAccessorImpl.newInstance0(…
+ (cold) java/lang/Module.defineModule0(…
+ (cold) java/lang/Module.addReads0(Ljava/lang/Module;Ljava/lang/Module;)V
+ (cold) java/lang/Module.addExports0(…
+ (cold) java/lang/Module.addExportsToAll0(Ljava/lang/Module;Ljava/lang/String;)V
+ (warm) java/util/HashMap.hash(Ljava/lang/Object;)I
+ (warm) java/util/HashMap.putVal(…
+ (cold) java/lang/Thread.setNameImpl(JLjava/lang/String;)V
+ (warm) java/lang/Math.floorMod(II)I
+ (warm) java/lang/Math.floorDiv(II)I
$ java –Xjit:verbose
-jar uber.jar
“Dynamic” AOT through ShareClasses
Shared Classes
Cache
AOTROM Classes
$ java –Xshareclasses -jar uber.jar
55
Cool!
How can I get
involved?
Wrap-up: Want to get involved?
§ Download OpenJDK with OpenJ9 and try it out!
– https://adoptopenjdk.net/releases.html?variant=openjdk9-openj9
– Run on your favourite Java application and let us know how it went!
§ Interact with our community via Github issues
– https://github.com/eclipse/openj9
– Ask questions, report problems, report Amazing Results
– Download the code, build it yourself, play around!
– Submit pull requests, see them tested on multiple platforms in the open
§ Whatever you think will make Eclipse OpenJ9 better, we’d love to hear it
56
Learn more at Java One!
§ Have even more questions? Dan Heidinga, Mark Stoodley, John Duimovich
Ask the OpenJ9 Architects [CON2672]
Wednesday, Oct 04, 8:30 a.m. - 9:15 a.m. | Moscone West - Room 2011
§ Learn about microservices for open testing with Shelley Lambert
Cloud-Based Test Microservices [CON2789]
Thursday, Oct 05, 11:45 a.m. - 12:30 p.m. | Marriott Marquis (Yerba Buena Level) - Salon 12
§ Debugging runtimes with Dan Heidinga for Bjørn Vårdal
Secrets of Building a Debuggable Runime [CON4081]
Thursday, Oct 05, 12:45 p.m. - 1:30 p.m. | Marriott Marquis (Yerba Buena Level) - Salon 15
§ Visit the Eclipse Foundation booth (6140)
Dan Heidinga & Mark Stoodley today from 4:00 - 5:45
Mark Stoodley on Wednesday from 2:30 - 4:30
57
Questions?
58
Dan Heidinga
daniel_heidinga@ca.ibm.com
@DanHeidinga
59
Legal Notice
IBM and the IBM logo are trademarks or registered trademarks of IBM Corporation, in the United States, other
countries or both.
Java and all Java-based marks, among others, are trademarks or registered trademarks of Oracle in the United
States, other countries or both.
Other company, product and service names may be trademarks or service marks of others.
THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL
PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND
ACCURACY OF THE INFORMATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT
OF THE USE OF, OR OTHERWISE RELATED TO, SUCH INFORMATION. ANY INFORMATION
CONCERNING IBM'S PRODUCT PLANS OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT
NOTICE.

Más contenido relacionado

La actualidad más candente

z/OS Communications Server Technical Update
z/OS Communications Server Technical Updatez/OS Communications Server Technical Update
z/OS Communications Server Technical UpdatezOSCommserver
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLJohn David Duncan
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a NutshellRangHo Lee
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Ajinkya Saswade
 
Declarative UIs with Jetpack Compose
Declarative UIs with Jetpack ComposeDeclarative UIs with Jetpack Compose
Declarative UIs with Jetpack ComposeRamon Ribeiro Rabello
 
zOSMF SDSF_ShareLab_V2R5.pdf
zOSMF SDSF_ShareLab_V2R5.pdfzOSMF SDSF_ShareLab_V2R5.pdf
zOSMF SDSF_ShareLab_V2R5.pdfMarna Walle
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework CoreKiran Shahi
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptxGDSCVJTI
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android WorkshopOpersys inc.
 
Building and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSBuilding and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSJoris Kuipers
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.Icalia Labs
 
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CS
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CSTCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CS
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CSzOSCommserver
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...Edge AI and Vision Alliance
 

La actualidad más candente (20)

z/OS Communications Server Technical Update
z/OS Communications Server Technical Updatez/OS Communications Server Technical Update
z/OS Communications Server Technical Update
 
ZD&T Survival Kit
ZD&T Survival KitZD&T Survival Kit
ZD&T Survival Kit
 
Developing for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQLDeveloping for Node.JS with MySQL and NoSQL
Developing for Node.JS with MySQL and NoSQL
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a Nutshell
 
Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI Android jetpack compose | Declarative UI
Android jetpack compose | Declarative UI
 
React Native na globo.com
React Native na globo.comReact Native na globo.com
React Native na globo.com
 
Declarative UIs with Jetpack Compose
Declarative UIs with Jetpack ComposeDeclarative UIs with Jetpack Compose
Declarative UIs with Jetpack Compose
 
Workshop React.js
Workshop React.jsWorkshop React.js
Workshop React.js
 
zOSMF SDSF_ShareLab_V2R5.pdf
zOSMF SDSF_ShareLab_V2R5.pdfzOSMF SDSF_ShareLab_V2R5.pdf
zOSMF SDSF_ShareLab_V2R5.pdf
 
webworkers
webworkerswebworkers
webworkers
 
Entity Framework Core
Entity Framework CoreEntity Framework Core
Entity Framework Core
 
Jetpack Compose.pptx
Jetpack Compose.pptxJetpack Compose.pptx
Jetpack Compose.pptx
 
Embedded Android Workshop
Embedded Android WorkshopEmbedded Android Workshop
Embedded Android Workshop
 
Swift Introduction
Swift IntroductionSwift Introduction
Swift Introduction
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
Building and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECSBuilding and running Spring Cloud-based microservices on AWS ECS
Building and running Spring Cloud-based microservices on AWS ECS
 
Hybrid Mobile App
Hybrid Mobile AppHybrid Mobile App
Hybrid Mobile App
 
Introduction to Swift programming language.
Introduction to Swift programming language.Introduction to Swift programming language.
Introduction to Swift programming language.
 
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CS
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CSTCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CS
TCP/IP Stack Configuration with Configuration Assistant for IBM z/OS CS
 
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ..."Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
"Building Complete Embedded Vision Systems on Linux—From Camera to Display," ...
 

Similar a JavaOne 2017: Eclipse OpenJ9: Under the hood of the JVM

JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityDanHeidinga
 
J9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVMJ9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVMDanHeidinga
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVM
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVMThe JVM in the Cloud: OpenJ9 and the traditional HotSpot JVM
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVMAndy Moncsek
 
Master your java_applications_in_kubernetes
Master your java_applications_in_kubernetesMaster your java_applications_in_kubernetes
Master your java_applications_in_kubernetesAndy Moncsek
 
Migrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesMigrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesDanHeidinga
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and FriendsYun Zhi Lin
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerGraham Charters
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahNick Plante
 
Bci for Beginners
Bci for BeginnersBci for Beginners
Bci for BeginnersIainLewis
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginersdivaskrgupta007
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdfAna-Maria Mihalceanu
 
The Power of the JVM: Applied Polyglot Projects with Java and JavaScript
The Power of the JVM: Applied Polyglot Projects with Java and JavaScriptThe Power of the JVM: Applied Polyglot Projects with Java and JavaScript
The Power of the JVM: Applied Polyglot Projects with Java and JavaScriptHazelcast
 
Englishman in new york => scala for java developer
Englishman in new york =>  scala for java developerEnglishman in new york =>  scala for java developer
Englishman in new york => scala for java developerAnton Naumov
 
Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applicationsequisodie
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKJosé Paumard
 

Similar a JavaOne 2017: Eclipse OpenJ9: Under the hood of the JVM (20)

JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
 
J9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVMJ9: Under the hood of the next open source JVM
J9: Under the hood of the next open source JVM
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVM
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVMThe JVM in the Cloud: OpenJ9 and the traditional HotSpot JVM
The JVM in the Cloud: OpenJ9 and the traditional HotSpot JVM
 
Master your java_applications_in_kubernetes
Master your java_applications_in_kubernetesMaster your java_applications_in_kubernetes
Master your java_applications_in_kubernetes
 
Migrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategiesMigrate Early, Migrate Often: JDK release cadence strategies
Migrate Early, Migrate Often: JDK release cadence strategies
 
Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
Open j9 jdk on RISC-V
Open j9 jdk on RISC-VOpen j9 jdk on RISC-V
Open j9 jdk on RISC-V
 
Optimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for DockerOptimizing Spring Boot apps for Docker
Optimizing Spring Boot apps for Docker
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 
Bci for Beginners
Bci for BeginnersBci for Beginners
Bci for Beginners
 
java basic for begginers
java basic for begginersjava basic for begginers
java basic for begginers
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
The Power of the JVM: Applied Polyglot Projects with Java and JavaScript
The Power of the JVM: Applied Polyglot Projects with Java and JavaScriptThe Power of the JVM: Applied Polyglot Projects with Java and JavaScript
The Power of the JVM: Applied Polyglot Projects with Java and JavaScript
 
Englishman in new york => scala for java developer
Englishman in new york =>  scala for java developerEnglishman in new york =>  scala for java developer
Englishman in new york => scala for java developer
 
Being agile with modern Java
Being agile with modern JavaBeing agile with modern Java
Being agile with modern Java
 
Building maintainable javascript applications
Building maintainable javascript applicationsBuilding maintainable javascript applications
Building maintainable javascript applications
 
Deep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UKDeep Dive Java 17 Devoxx UK
Deep Dive Java 17 Devoxx UK
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 

Último

Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfIdiosysTechnologies1
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 

Último (20)

Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Best Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdfBest Web Development Agency- Idiosys USA.pdf
Best Web Development Agency- Idiosys USA.pdf
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 

JavaOne 2017: Eclipse OpenJ9: Under the hood of the JVM

  • 1. Dan Heidinga, OpenJ9 Project Lead IBM Runtimes J9 Interpreter Lead Daniel_Heidinga@ca.ibm.com @DanHeidinga Oct 3, 2017 OpenJ9: Under the Hood of the Next Open Source JVM
  • 2. 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 2
  • 3. Who am I? § I've been involved with virtual machine development at IBM since 2007 and am now the J9 Virtual Machine Team Lead. J9 is IBM's independent implementation of the JVM. § I've represented IBM on both the JSR 292 ('invokedynamic') and JSR 335 ('lambda') expert groups and lead J9's implementation of both JSRs. § I’ve also maintain the bytecode verifier and deal with various other parts of the runtime. § Now one of the Project Leads for the Eclipse OpenJ9 JVM. 3
  • 4. Dan Heidinga, OpenJ9 Project Lead IBM Runtimes J9 Interpreter Lead Daniel_Heidinga@ca.ibm.com @DanHeidinga Oct 3, 2017 Eclipse OpenJ9: Under the Hood of the Next Open Source JVM
  • 5. http://www.eclipse.org/openj9 https://github.com/eclipse/openj9 Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/openj9/blob/master/CONTRIBUTING.md Eclipse OpenJ9 Created Sept 2017
  • 7. $ git clone https://github.com/ibmruntimes/openj9-openjdk-jdk9 $ cd openj9-openjdk-jdk9 $ bash ./get_source.sh $ bash ./configure --with-freemarker-jar=freemarker.jar $ make images $ cd build/linux-x86_64-normal-server-release/images/ $ ./jdk/bin/java -version 7 Building OpenJDK with OpenJ9
  • 9. 9
  • 11. 11 The VM has connections into the rest of the JDK
  • 12. 12 OpenJDK with Eclipse OpenJ9 To build OpenJDK with OpenJ9 requires patches • Build process • Class libraries
  • 14. Build an open reusable language runtime foundation for cloud platforms – To accelerate advancement and innovation – In full cooperation with existing language communities – Engaging a diverse community of people interested in language runtimes • Professional developers • Researchers • Students • Hobbyists Eclipse OMR Mission
  • 15. http://www.eclipse.org/omr https://github.com/eclipse/omr https://developer.ibm.com/open/omr/ Dual License: Eclipse Public License v2.0 Apache 2.0 Users and contributors very welcome https://github.com/eclipse/omr/blob/master/CONTRIBUTING.md Eclipse OMR Created March 2016
  • 16.
  • 17. public class HelloService { public static void main(…) { System.out.println(“Hello”); } } 17
  • 18. $ java -jar uber.jar 18
  • 19. $ java -jar uber.jar 19 Hello $
  • 21. 21
  • 25. $ java -jar uber.jar 25 Hello $
  • 27. 27 … class load: jdk/internal/org/objectweb/asm/FieldVisitor from: jrt:/java.base class load: jdk/internal/org/objectweb/asm/FieldWriter from: jrt:/java.base class load: java/lang/ClassLoader$$Lambda$3/00000000702E91F0 class load: HelloService from: file:/openj9/uber.jar class load: jdk/internal/reflect/UnsafeFieldAccessorFactory from: jrt:/java.base class load: jdk/internal/reflect/FieldAccessor from: jrt:/java.base class load: jdk/internal/reflect/FieldAccessorImpl from: jrt:/java.base class load: jdk/internal/reflect/UnsafeFieldAccessorImpl from: jrt:/java.base class load: jdk/internal/reflect/UnsafeObjectFieldAccessorImpl from: jrt:/java.base class load: java/lang/Class$ReflectCache from: jrt:/java.base class load: java/lang/annotation/Annotation from: jrt:/java.base class load: jdk/internal/reflect/CallerSensitive from: jrt:/java.base ….
  • 28. “Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.” –Rob Pike (known for Plan 9, UTF-8, Go) 28
  • 29. 29
  • 30. public class HelloService { public static void main(…) { System.out.println(“Hello”); } } 30 What does the JVM do to find that main method?
  • 31. 31
  • 32. J9ROMClass: a better classfile § Keep all the symbolic info from a classfile § Remove variability (where possible) § Position independent: map anywhere in the address space § ROM: Read only once written – Learn from the Smalltalk past 32 ROMClass
  • 33. Conversion to ROM 33 Classfile Static Verification ROMClassROM Class Builder https://github.com/eclipse/openj9/tree/master/runtime/bcverify https://github.com/eclipse/openj9/tree/master/runtime/bcutil
  • 35. Self-relative pointers 35 0x20 0x20 0x28 0x30 0x38 0x40 0x48 0x50 0x58 0x60 0x30 + *(0x30) = 0x30 + 0x20 = 0x50 Address of slot + value = target address
  • 36. typedef struct J9ROMClass { U_32 romSize; U_32 singleScalarStaticCount; J9SRP className; J9SRP superclassName; U_32 modifiers; U_32 extraModifiers; U_32 interfaceCount; J9SRP interfaces; U_32 romMethodCount; J9SRP romMethods; U_32 romFieldCount; J9SRP romFields; U_32 objectStaticCount; U_32 doubleScalarStaticCount; U_32 ramConstantPoolCount; U_32 romConstantPoolCount; ... } J9ROMClass; J9ROMClass ROM Constant pool interfaces J9ROMMethods . . .
  • 37. 37 public static void main(java.lang.String[]) 0 JBgetstatic 2 System.out LPrintStream; 3 JBldc 3 (java.lang.String) "Hello” 5 JBinvokevirtual 4 PrintStream.println(LString;)V 8 JBreturn Java’s late bound… Isn’t it slow to resolve the fields / methods every time?
  • 38. From ROM to RAM 38 RAM class creation Load superclases Load superinterfaces Calculate vtable ROMClass J9RAMClass https://github.com/eclipse/openj9/blob/master/runtime/vm/createramclass.cpp
  • 39. typedef struct J9Class { UDATA eyecatcher; struct J9ROMClass* romClass; struct J9Class** superclasses; UDATA classDepthAndFlags; struct J9ClassLoader* classLoader; j9object_t classObject; UDATA volatile initializeStatus; struct J9Method* ramMethods; UDATA* ramStatics; struct J9Class* arrayClass; UDATA totalInstanceSize; UDATA* instanceDescription; UDATA packageID; void** iTable; void** jniIDs; struct J9Class* replacedClass; UDATA* ramConstantPool; . . . } J9Class; J9Class VTable JIT VTable RAM Constant pool J9Methods
  • 40. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3
  • 41. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3
  • 42. ShareClasses: ROM pays off JVM 1 JVM 2 JVM 3 Shared Classes Cache Faster startup, Smaller footprint
  • 43. 43 ROMClass J9RAMClass Cool native memory! How does this show up for my Java code?
  • 44. Classloading: tying it all together 44 ROMClass J9RAMClass J9ClassLoader java.lang.Class java.lang.ClassLoader Heap Native
  • 45. 45 public static void main(java.lang.String[]) 0 JBgetstatic 2 System.out LPrintStream; 3 JBldc 3 (java.lang.String) "Hello” 5 JBinvokevirtual 4 PrintStream.println(LString;)V 8 JBreturn That’s all good but what about actually running my code???
  • 46. Execution context: the Thread 46 J9VMThreadJ9VMThreadJ9JavaVM omrthread_t omrthread_t omrthread_t Heap Native java.lang.Thread java.lang.Thread java.lang.Thread
  • 50. Interpreter § Written in C++ § Switch statement / computed goto § Executes: – bytecodes – INLs – builds stack frames § Transition to the JIT 50 https://github.com/eclipse/openj9/blob/master/runtime/vm/BytecodeInterpreter.hpp
  • 51. JIT Compilation ARM Optimizer Analyses and Optimizations cold warm hot FSDscorching AOT IL Generation x86 POWER Z Code Generators Runtime Environment/ Configuration •Options •Object Model •Memory •Threading •Tracing codeMetadataRuntimeRT Helpers very hot profiling Profile Manager Hardware counters Sampling Thread Interpreter Profile Info JIT Profile Info Profiler
  • 52. Adaptive JIT Compilation 52 § Methods start out running bytecode form directly § After many invocations (or via sampling) code get compiled at ‘cold’ or ‘warm’ level § Low overhead sampling thread is used to identify hot methods § Methods may get recompiled at ‘hot’ or ‘scorching’ levels (for more optimizations) § Transition to ‘scorching’ goes through a temporary profiling step cold hot scorching profiling interpreter warm
  • 53. 53 + (cold) jdk/internal/reflect/NativeConstructorAccessorImpl.newInstance0(… + (cold) java/lang/Module.defineModule0(… + (cold) java/lang/Module.addReads0(Ljava/lang/Module;Ljava/lang/Module;)V + (cold) java/lang/Module.addExports0(… + (cold) java/lang/Module.addExportsToAll0(Ljava/lang/Module;Ljava/lang/String;)V + (warm) java/util/HashMap.hash(Ljava/lang/Object;)I + (warm) java/util/HashMap.putVal(… + (cold) java/lang/Thread.setNameImpl(JLjava/lang/String;)V + (warm) java/lang/Math.floorMod(II)I + (warm) java/lang/Math.floorDiv(II)I $ java –Xjit:verbose -jar uber.jar
  • 54. “Dynamic” AOT through ShareClasses Shared Classes Cache AOTROM Classes $ java –Xshareclasses -jar uber.jar
  • 55. 55 Cool! How can I get involved?
  • 56. Wrap-up: Want to get involved? § Download OpenJDK with OpenJ9 and try it out! – https://adoptopenjdk.net/releases.html?variant=openjdk9-openj9 – Run on your favourite Java application and let us know how it went! § Interact with our community via Github issues – https://github.com/eclipse/openj9 – Ask questions, report problems, report Amazing Results – Download the code, build it yourself, play around! – Submit pull requests, see them tested on multiple platforms in the open § Whatever you think will make Eclipse OpenJ9 better, we’d love to hear it 56
  • 57. Learn more at Java One! § Have even more questions? Dan Heidinga, Mark Stoodley, John Duimovich Ask the OpenJ9 Architects [CON2672] Wednesday, Oct 04, 8:30 a.m. - 9:15 a.m. | Moscone West - Room 2011 § Learn about microservices for open testing with Shelley Lambert Cloud-Based Test Microservices [CON2789] Thursday, Oct 05, 11:45 a.m. - 12:30 p.m. | Marriott Marquis (Yerba Buena Level) - Salon 12 § Debugging runtimes with Dan Heidinga for Bjørn Vårdal Secrets of Building a Debuggable Runime [CON4081] Thursday, Oct 05, 12:45 p.m. - 1:30 p.m. | Marriott Marquis (Yerba Buena Level) - Salon 15 § Visit the Eclipse Foundation booth (6140) Dan Heidinga & Mark Stoodley today from 4:00 - 5:45 Mark Stoodley on Wednesday from 2:30 - 4:30 57
  • 59. 59 Legal Notice IBM and the IBM logo are trademarks or registered trademarks of IBM Corporation, in the United States, other countries or both. Java and all Java-based marks, among others, are trademarks or registered trademarks of Oracle in the United States, other countries or both. Other company, product and service names may be trademarks or service marks of others. THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, SUCH INFORMATION. ANY INFORMATION CONCERNING IBM'S PRODUCT PLANS OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.