Hardware and JVM Design Trends? Those Don’t Affect Me! Or Do They?
Dan Heidinga Eclipse OpenJ9 Project Lead Interpreter Lead, IBM Runtimes @danheidinga DanHeidinga
Hardware and JVM Design Trends? Those Dont Affect Me! Or Do They? - - PowerPoint PPT Presentation
Hardware and JVM Design Trends? Those Dont Affect Me! Or Do They? Dan Heidinga Eclipse OpenJ9 Project Lead Interpreter Lead, IBM Runtimes @danheidinga DanHeidinga Important disclaimers THE INFORMATION CONTAINED IN THIS PRESENTATION IS
Dan Heidinga Eclipse OpenJ9 Project Lead Interpreter Lead, IBM Runtimes @danheidinga DanHeidinga
§ 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
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
§ One of the Project Leads for the Eclipse OpenJ9 JVM. § I've been involved with virtual machine development at IBM
since 2007 and lead IBM’s Interpreter team working on OpenJ9.
§ I've represented IBM on both the JSR 292 ('invokedynamic')
and JSR 335 ('lambda') expert groups and lead J9's implementation of both JSRs. And am now involved in Project Valhalla and Panama.
§ I’ve also maintain the bytecode verifier and deal with various
3
§ Moore’s law and singled threaded performance § The multicore explosion § Multi-tenant: bare metal, virtualization & containers § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
4
§ Moore’s law and singled threaded performance § The multicore explosion § Multi-tenant: bare metal, virtualization & containers § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
5
6
https://commons.wikimedia.org/wiki/File:Moore%27s_Law_Transistor_Count_1971-2016.png
§ The number of transistors doubles
every two years
§ Amazing single threaded
performance improvements
7
§ Cooperative suspend (1999) § Adaptive compilation (1999) § Escape analysis and stack allocating
§ Real Time Specification for Java (2005 -
2011)
§ Dynamic Ahead of Time compiled code
in production (2006)
§ Hot code replacement (2007) § Compressed references (2007) § Metronome soft real-time GC (2008)
Resource sharing? Not so much!
9
10
§ Moore’s law and singled threaded performance § The multicore explosion § Multi-tenant: bare metal, virtualization & containers § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
11
12
§ ~2006 RIP Moore’s Law? § Singled threaded performance no
longer growing by leaps and bounds
§ Welcome to the multicore
revolution
https://commons.wikimedia.org/wiki/File:Moore%27s_Law_Transistor_Count_1971-2016.png
13
§ ForkJoinPool brought the concept of work stealing to user code in Java 7 – The same technique that Java’s GC’s used to parallelize garbage
collection
§ Java 8 continued the trend towards parallelism with the introduction of
Lambda, ParallelStreams and Spliterators
§ The focus still on peak performance – but now it’s up to you (and the platform) to write good multithread code
14
15
https://xkcd.com/303/
16
17
§ 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
§ Transition to ‘scorching’ goes through a temporary profiling step
cold hot scorching profiling interpreter warm
§ Moore’s law and singled threaded performance § The multicore explosion § Multi-tenant: bare metal, virtualization & containers § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
18
19
http://www.fanpop.com/clubs/home-improvement-tv-show/images/33144922/title/wilson-wallpaper
20
21
Classfile ROMClass J9RAMClass
22
23
24
Shared Classes Cache
Balloon drivers
–XX:+IdleTuningGcOnIdle -XX:+IdleTuningCompactOnIdle
https://developer.ibm.com/javasdk/2017/09/25/still-paying-unused-memory-java-app-idle/
“…around 30 percent of data center servers have not delivered information or computing services in the last six months.”
Container Support
§ Container detection mechanism (-XX:+UseContainerSupport) – This allows JVM to tune itself based on limits imposed by the container. § Increase default heap size when running in container – JVM is typically the only application in the container – Reserve a larger chunk of container memory for heap § Better utilization of memory available to the container § -XX:MaxRAMPercentage and -XX:InitialRAMPercentage – Existing options for adjusting heap -Xmx/-Xms accept absolute values. – Cumbersome to adjust –Xmx/-Xms when container memory limit can vary – Adjust the heap based on percentage of the physical memory rather than an
absolute value.
§ Adjust Runtime.availableProcessors() based on cgroup limits § Add container limits to the Javacore file
OpenJ9 JIT memory auto-scaling based on container limits
instability!
29
§ Moore’s law and singled threaded performance § The multicore explosion § Multi-tenant: bare metal, virtualization & containers § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
30
31
32
Checkout Compile Test Deploy
Making it faster and cheaper to get ideas into production with less risk
33
34
35
https://github.com/apache/incubator-openwhisk/blob/master/docs/images/OpenWhisk.png
36
37
38
39
Shared Classes Cache AOT ROM Classes
& all URLClassloader-subclasses
New AOT ramp up and throughput on Liberty Daytrader7
OpenJ9 default JIT vs –Xtune:virtualized with old AOT vs –Xtune:virtualized with new AOT
§Improved mechanism for profiling compiled code. –Careful placement of counters –Conditionally patch code to enable / disable §Reduces the dependency on interpreter profiling. àGets into compiled code faster àDon’t sacrifice profiling quality
42
S I A C D B E F G H X
https://github.com/eclipse/openj9/blob/master/doc/compiler/JProfiling.md
§ Moore’s law and singled threaded performance § The multicore explosion § Virtualization enters the arena § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
43
44
https://upload.wikimedia.org/wikipedia/commons/thumb/2/25/Spectre_with_text.svg/702px-Spectre_with_text.svg.png
§ Moore’s law and singled threaded performance § The multicore explosion § Virtualization enters the arena § The deployment strategy shift § Spectre: Caught passing bad checks § Cloud as an opportunity
45
46
47
App JIT App JIT App JIT App JIT
48
App App App App JIT
§ The application life cycle has changed – no longer dominated by uptime. – Frequent restarts are the new reality. – Startup is now critical to your application! § The JVM is becoming a good neighbor – Intelligent resource usage matters… including giving them back § The free lunch is over – Expect to spend more and more time looking at resource usage, performance
and footprint.
49
https://adoptopenjdk.net/releases.html?variant=openjdk11&jvmVariant=openj9 https://adoptopenjdk.net/releases.html?variant=openjdk8&jvmVariant=openj9 https://github.com/eclipse/openj9 https://openj9.slack.com/
50
51
Dan Heidinga Eclipse OpenJ9 Project Lead Interpreter Lead, IBM Runtimes @danheidinga DanHeidinga
52
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.