SlideShare a Scribd company logo
Copyright © 2019 Oracle and/or its affiliates.
The following is intended to outline our general product direction. It is intended for information purposes
only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions. The development,
release, timing, and pricing of any features or functionality described for Oracle’s products may change
and remains at the sole discretion of Oracle Corporation.
Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and
prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed
discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and
Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q
under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website
at http://www.oracle.com/investor. All information in this presentation is current as of September 2019
and Oracle undertakes no duty to update any statement in light of new information or future events.
Safe Harbor
Copyright © 2019 Oracle and/or its affiliates.
JDK Mission Control:
Where We Are, Where We Are Going
Principal Member of Technical Staff
Java Platform Group
September 16, 2019
David Buck
Copyright © 2019 Oracle and/or its affiliates.
JVM Sustaining Engineer
OpenJDK 8 Update Project
Maintainer
JavaOne Rock Star
Co-author of Oracle WebLogic
Server 11g 構築・運用ガイド
@DavidBuckJP
https://blogs.oracle.com/buck/
Who am I? David Buck (left)
• Background / History
• Building
• Demo
• Takaways
Copyright © 2019 Oracle and/or its affiliates.
Agenda
Introduction to JDK Mission Control and JDK Flight Recorder [DEV2316]
Marcus Hirt and Klara Ward
Monday 16:00 Moscone South Room 202
Improving Observability in Your Application with JFR and JMC [DEV3460]
Marcus Hirt and Mario Torre
Tuesday 11:30 Moscone South Room 201
Java Flight Recorder: Black Box of Java Applications[DEV3957]
Poonam Parhar
Wednesday 12:30 Moscone South Room 203
Robotics on JDK 11? With Modules? Are You… [DEV2329]
Marcus Hirt, Miro Wengner, and Robert Savage
Wednesday 16:00 Moscone South Room 313
Four Productive Ways to Use Open Source JFR and JMC Revisited [DEV3118]
Sven Reimers and Martin Klähn
Thursday 11:15 Moscone South Room 304
Enhanced Java Flight Recorder at Alibaba [DEV3667]
Sanhong Li, Fangxi Yin, and Guangyu Zhu
Thursday 12:15 Moscone South Room 203
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Hirofumi Iwasaki and Hiroaki Nakada
Thursday 13:15 Moscone South Room 201
Introduction to JDK Mission Control and JDK Flight Recorder [DEV2316]
Marcus Hirt and Klara Ward
Monday 16:00 Moscone South Room 202
Improving Observability in Your Application with JFR and JMC [DEV3460]
Marcus Hirt and Mario Torre
Tuesday 11:30 Moscone South Room 201
Java Flight Recorder: Black Box of Java Applications[DEV3957]
Poonam Parhar
Wednesday 12:30 Moscone South Room 203
Robotics on JDK 11? With Modules? Are You… [DEV2329]
Marcus Hirt, Miro Wengner, and Robert Savage
Wednesday 16:00 Moscone South Room 313
Four Productive Ways to Use Open Source JFR and JMC Revisited [DEV3118]
Sven Reimers and Martin Klähn
Thursday 11:15 Moscone South Room 304
Enhanced Java Flight Recorder at Alibaba [DEV3667]
Sanhong Li, Fangxi Yin, and Guangyu Zhu
Thursday 12:15 Moscone South Room 203
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Hirofumi Iwasaki and Hiroaki Nakada
Thursday 13:15 Moscone South Room 201
Background
Several Closely Related Technologies
(JRockit / Java / JDK) Mission Control
Flight Recording
Oracle JDK: JDK 7
OpenJDK: JDK 11
JEP 167: Event-Based JVM Tracing (JDK 7)
JEP 328: Flight Recorder (JDK 11)
Flight Recorder
Technology to generate and persist JVM event data
Low-overhead
Intended for use in production
Viable for “always on” use-case
Mission Control
Eclipse-based (RCP) GUI tool
Visualization of Flight Recording data
Automated Flight Recording analysis
JMX console for real-time monitoring (and control) of target
Plug-in framework for additional functionality
Support for integration into Eclipse IDE
Mission Control
Eclipse-based (RCP) GUI tool
Visualization of Flight Recording data
Automated Flight Recording analysis
JMX console for real-time monitoring (and control) of target
Plug-in framework for additional functionality
Support for integration into Eclipse IDE
History
Our Story Begins in Sweden
By Holger.Ellgaard - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=5623391
JRockit
Developed by Stockholm-based
Appeal Virtual Systems
JIT-only JVM (no interpreter)
Heavily focused on Intel (x86 /
AMD64 / IA64) performance
Value Add
JRockit was originally sold as a “Virtual Machine for Java”
Sun required each Java licensee to have a “value add”
“Superior performance” didn’t go over well...
JRockit’s monitoring and management tools were presented as its
value add to differentiate itself from Sun’s offerings
Alex Flury at English Wikipedia [Public domain]
By VARA - Beeld- en Geluidwiki, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=49198465
Appeal Virtual Machines
2002
Appeal Virtual Machines
BEA Systems
BEA Systems
2008
BEA Systems
BEA Systems
2009
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
A Combined Legacy
JRockit’s best features ported over to HotSpot
Diagnostic commands (JDK 7)
Compiler control (JDK 9)
Native memory tracking (JDK 7)
Flight Recorder (JDK 7)
Build system (behind the scenes) (JDK 8)
JRockit Mission Control -> Java Mission Control
JRockit Mission Control 1
JRockit Runtime Analyzer
Based on experience gained while consulting
“Cast a big net” to avoid multiple support iterations
Most data collection piggy-backed onto internal JVM operations
(low overhead)
Data persisted at zipped XML
JRockit Mission Control 2
JRockit Mission Control 3
JRockit Mission Control 4
Post Oracle acquisition (JRockit R28)
Flight Recorder replaces JRockit Runtime Analyzer
XML data -> binary data
Much lower overhead to collect and persist data
Java Mission Control 5
Flight Recorder in HotSpot
Flight Recorder support added in 7u40
JMC 5 bundled with JDK
JDK 7 JMC 5
JDK 8 JMC 5.5
JDK 9 JMC 6
JDK 10 JMC 6
2018
JDK Mission Control 7
Open source
No longer bundled with JDK (as of JDK 11)
Flight Recorder implementation open sourced (as of JDK 11)
Universal Permissive License
Clear patent protection
Clear & simplified relicensing
Reduced overhead in source files
It can be used as a contributor agreement
See FAQ (link at end of slide deck) for details
Universal Permissive License
Clear patent protection
Clear & simplified relicensing
Reduced overhead in source files
It can be used as a contributor agreement
See FAQ (link at end of slide deck) for details
Oracle Contributor Agreement
Must be signed and sent to Oracle to contribute code to Mission
Control
Same requirement as other OpenJDK projects
Only needs to be done once
“...you're doing an awesome job in building a real community and a
*very* open source project.“
- Red Hat Contributor to Marcus Hirt
jmc-dev alias, November 8, 2018
Compatibility
Flight Recording format changes between JDK versions
Mission Control has always been backwards compatible with flight
recordings from older HotSpot releases.
JDK 11 requires JMC 7
JMC 7 is currently the only version that supports all HotSpot based
flight recordings
Building
Requirements
Mercurial (hg)
Maven
JDK 8
OpenJDK JMC repositories
jmc Mainline Development Branch
jmc-graphics images / branding resources
jmc7 JMC 7.0 branch
Copyright © 2019 Oracle and/or its affiliates.
GitHub Mirror
Only mainline development branch
Not in full sync at the moment
Recommend using hg until project Skara migration *
* Maybe...
A Tale of Two Shells...
Shell 1
cd releng/third-party
mvn p2:site
mvn jetty:run
Shell 2
cd core
mvn install
cd ..
mvn clean package
A Tale of Two Shells...
Equinox p2: provisioning platform for OSGi artifacts and meta-data
Shell 1 sets up a p2 repository that hosts dependencies needed by
the build process run in shell 2
Cross Compilation?!
Regardless of build platform, binaries for all three target platforms
are generated
Platform-dependent bits are downloaded as dependencies
Building
Quick and easy to do
Builds virtually out of the box on most Linux distros
Build platform does not need to match target platform
Demo
Safepoints
Stop-the-World implementation
Guarantees Java state of thread is known
All threads executing Java code must stop
JNI code can continue
Cooperative suspension
Polling based
By YPLeroux at English Wikipedia, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=17734859
Safepoints
Stop-the-World implementation
Guarantees Java state of thread is known
All threads executing Java code must stop
JNI code can continue
Cooperative suspension
Polling based
By YPLeroux at English Wikipedia, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=17734859
Safepoint Polling
Interpreter can stop instantly
template dispatch table replaced
“polling” is essentially free
Explicit poll inserted into C1/C2 JIT output
Global safepoint polling page in address space
Poll implemented by attempted read of this address
Safepoint triggered by change in page permissions
JIT Safepoint Polling
On return from method call
Backend branches in most loops
Any transition to native code (JVM / JNI)
Collatz Conjecture
Simple rules:
If number is even, divide by 2
If number is odd, multiply by 3 and add 1
Conjecture: Start with any positive integer, and you’ll eventually
end up at 1
An open problem in math
Collatz Conjecture Examples
2 1
3 10 5 16 8 4 2 1
4 2 1
5 16 8 4 2 1
6 3 10 5 16 8 4 2 1
7 22 11 34 17 52 26 13 40 20 10 5 16 8...
Collatz Conjecture Examples
2 1
3 10 5 16 8 4 2 1
4 2 1
5 16 8 4 2 1
6 3 10 5 16 8 4 2 1
7 22 11 34 17 52 26 13 40 20 10 5 16 8...
Collatz Conjecture
By Kunashmilovich - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=48786325
Let’s test the Collatz Conjecture...
Let’s test the Collatz Conjecture...
the stupidest way imaginable!
Testing the Collatz Conjecture
private static long next(long num) {
return (num%2 == 0) ? num / 2 : 3 * num + 1;
}
Testing the Collatz Conjecture
public static void main(String[] args) {
long num;
for (int i=2; i < Integer.MAX_VALUE; i++) {
num = i;
for (int j=0; j < Integer.MAX_VALUE; j++) {
num = next(num);
if (num == 1) break;
}
if (num != 1) {
System.out.println(i + " did not end at 1.");
System.exit(-1);
} else if (i % 1000000 == 0) {
System.out.println("done with " + i);
}
}
}
Counted Loop
Loop that increments / decrements an int index
Worst case scenario, we loop 4 billion times (very short)
HotSpot may not bother adding a safepoint pool to the loop
Testing the Collatz Conjecture
public static void main(String[] args) {
long num;
for (int i=2; i < Integer.MAX_VALUE; i++) {
num = i;
for (int j=0; j < Integer.MAX_VALUE; j++) {
num = next(num);
if (num == 1) break;
}
if (num != 1) {
System.out.println(i + " did not end at 1.");
System.exit(-1);
} else if (i % 1000000 == 0) {
System.out.println("done with " + i);
}
}
}
Testing the Collatz Conjecture
public static void main(String[] args) {
long num;
for (int i=2; i < Integer.MAX_VALUE; i++) {
num = i;
for (int j=0; j < Integer.MAX_VALUE; j++) {
num = next(num);
if (num == 1) break;
}
if (num != 1) {
System.out.println(i + " did not end at 1.");
System.exit(-1);
} else if (i % 1000000 == 0) {
System.out.println("done with " + i);
}
}
}
Profiler Types
Sampling Profiler
Process sampled periodically
Invocation count is not exact
Observer effect should be
negligible
Invocation Counter Profiler
Code is instrumented
Exact number of invocations
Observer effect often distorts
results
Profiler Types
Sampling Profiler
Process sampled periodically
Invocation count is not exact
Observer effect should be
negligible
Invocation Counter Profiler
Code is instrumented
Exact number of invocations
Observer effect often distorts
results
Traditional Sampler
JVMTI / Bytecode instrumentation can only stop thread at a
safepoint poll
What happens between safpoint polls is invisible to the profiler
VisualVM
JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]
Flight Recording
Can asynchronously stop execution thread at any time
No dependence on safe points for profiling
HotSpot internal API (AsyncGetCallTrace)
Honest Profiler
Oracle Developer Studio
Flight Recorder
Mission Control
What happened?
Safepoints have corresponding metadata
Byte Code Index (bci)
Liveness data (what stack positions point to Java heap)
What happened?
By default, metadata is normally only generated for safepoints
DebugNonSafepoints flag forces metadata generation for all code
(obvious performance cost)
Flight Recorder
Mission Control
Flight Recorder
Mission Control
Takeaways
Open sourcing of JMC has been a great success
JMC 7 and higher are the ideal MC to use regardless of JDK version
Binary builds from Oracle should be available in the near future
JMC is simple to build on your own today
Flight Recording’s AsyncGetCallTrace-based profiling can provide a
level of accuracy unachievable by most other tools.
Thank You!
References
Marcus Hirt’s Blog
http://hirt.se/blog/
The Universal Permissive License (UPL)
https://oss.oracle.com/licenses/upl/
Session Survey
Help us make the content
even better. Please complete
the session survey in the
Mobile App.
Copyright © 2019 Oracle and/or its affiliates.
The preceding is intended to outline our general product direction. It is intended for information purposes
only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code,
or functionality, and should not be relied upon in making purchasing decisions. The development,
release, timing, and pricing of any features or functionality described for Oracle’s products may change
and remains at the sole discretion of Oracle Corporation.
Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and
prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed
discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and
Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q
under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website
at http://www.oracle.com/investor. All information in this presentation is current as of September 2019
and Oracle undertakes no duty to update any statement in light of new information or future events.
Safe Harbor
Copyright © 2019 Oracle and/or its affiliates.

More Related Content

PDF
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
PDF
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
PDF
invokedynamic for Mere Mortals [Code One 2019]
PDF
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
PDF
Java Bytecode Crash Course [Code One 2019]
PDF
JavaOne 2016: Life after Modularity
PPTX
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
PDF
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim
CSI (Crash Scene Investigation) HotSpot: Common JVM Crash Causes and Solution...
Java Concurrency, A(nother) Peek Under the Hood [Code One 2019]
invokedynamic for Mere Mortals [Code One 2019]
Hangs, Slowdowns, Starvation—Oh My! A Deep Dive into the Life of a Java Threa...
Java Bytecode Crash Course [Code One 2019]
JavaOne 2016: Life after Modularity
JavaOne 2015 CON5211 Digital Java EE 7 with JSF Conversations, Flows, and CDI...
JavaEE & GlassFish UG - Digital JavaEE 7 New & Noteworthy by P.Pilgrim

What's hot (20)

PDF
Clone Clone Make: a better way to build
PPTX
Future of Java EE with Java SE 8
PDF
Hotspot & AOT
PPTX
Java EE 7 for Real Enterprise Systems
PDF
JavaOne 2017: Eclipse OpenJ9: Under the hood of the JVM
PDF
Compile ahead of time. It's fine?
PPTX
FOSDEM 2017 - Open J9 The Next Free Java VM
PDF
Concierge - Bringing OSGi (back) to Embedded Devices
PDF
J9: Under the hood of the next open source JVM
PDF
CompletableFuture уже здесь
PDF
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
PDF
Hierarchy Viewer Internals
PDF
Haj 4344-java se 9 and the application server-1
ODP
Javaee6 Overview
PDF
Java EE 7: Boosting Productivity and Embracing HTML5
PDF
J9's MethodHandle Compilation Pipeline #JFokus2015
PPTX
FOSDEM 2017 - A different Lua JIT using Eclipse OMR
RTF
Readme
PDF
JDK9 Features (Summary, 31/Jul/2015) #JJUG
PDF
Building a web application with ontinuation monads
Clone Clone Make: a better way to build
Future of Java EE with Java SE 8
Hotspot & AOT
Java EE 7 for Real Enterprise Systems
JavaOne 2017: Eclipse OpenJ9: Under the hood of the JVM
Compile ahead of time. It's fine?
FOSDEM 2017 - Open J9 The Next Free Java VM
Concierge - Bringing OSGi (back) to Embedded Devices
J9: Under the hood of the next open source JVM
CompletableFuture уже здесь
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Hierarchy Viewer Internals
Haj 4344-java se 9 and the application server-1
Javaee6 Overview
Java EE 7: Boosting Productivity and Embracing HTML5
J9's MethodHandle Compilation Pipeline #JFokus2015
FOSDEM 2017 - A different Lua JIT using Eclipse OMR
Readme
JDK9 Features (Summary, 31/Jul/2015) #JJUG
Building a web application with ontinuation monads
Ad

Similar to JDK Mission Control: Where We Are, Where We Are Going [Code One 2019] (20)

PPTX
Java Mission Control in Java SE 7U40
PDF
Embedding Oracle Weblogic Server 1871199
PDF
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
PPTX
Splunk Conf 2014 - Splunking the Java Virtual Machine
PPTX
Oracle E2.0 WebCenter Portal Strategy
PPTX
Production Time Profiling Out of the Box
PPTX
EclipseOMRBuildingBlocks4Polyglot_TURBO18
PPTX
Revised Adf security in a project centric environment
PDF
Enabling NFV features in kubernetes
PPT
What's new in p2 (2009)?
PPT
Android presentation
PPTX
Open j9 jdk on RISC-V
RTF
Synopsis on online shopping by sudeep singh
PDF
RICOH THETA x IoT Developers Contest : Cloud API Seminar
PPTX
Selenium Training in Chandigarh
PPTX
VLSI Training presentation
PPTX
Selenium Training in Jalandhar
PPTX
Selenium Training in Amritsar
PDF
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
PPT
SynapseIndia mobile apps deployment framework architecture
Java Mission Control in Java SE 7U40
Embedding Oracle Weblogic Server 1871199
MuleSoft Surat Meetup#45 - Anypoint Flex Gateway as a Kubernetes Ingress Cont...
Splunk Conf 2014 - Splunking the Java Virtual Machine
Oracle E2.0 WebCenter Portal Strategy
Production Time Profiling Out of the Box
EclipseOMRBuildingBlocks4Polyglot_TURBO18
Revised Adf security in a project centric environment
Enabling NFV features in kubernetes
What's new in p2 (2009)?
Android presentation
Open j9 jdk on RISC-V
Synopsis on online shopping by sudeep singh
RICOH THETA x IoT Developers Contest : Cloud API Seminar
Selenium Training in Chandigarh
VLSI Training presentation
Selenium Training in Jalandhar
Selenium Training in Amritsar
[Oracle Webcast] Discover the Oracle Blockchain Platform through the eyes of ...
SynapseIndia mobile apps deployment framework architecture
Ad

More from David Buck (20)

PDF
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
PDF
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
PDF
Z Garbage Collector
PDF
Valhalla Update JJUG CCC Spring 2019
PDF
Var handles jjug_ccc_spring_2018
PDF
JDK 10 へようこそ
PDF
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
PDF
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
PDF
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
PDF
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
PDF
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
PDF
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
PDF
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
PDF
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
PDF
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
PDF
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
PDF
Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]
PDF
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
PDF
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
PPTX
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]
JDK 13 New Features [MeetUp with Java Experts! @Gaienmae/Dojima 2019]
JDK Mission Control: Where We Are, Where We Are Going [Groundbreakers APAC 20...
Z Garbage Collector
Valhalla Update JJUG CCC Spring 2019
Var handles jjug_ccc_spring_2018
JDK 10 へようこそ
Java SE 8におけるHotSpotの進化 [Java Day Tokyo 2014 C-2]
HotSpot のロック: A Peek Under the Hood [JJUG ナイトセミナ JVM 特集 2015年8月]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Java Debuggers: A Peek Under the Hood [JavaOne 2016 CON1503]
Lambda: A Peek Under The Hood [Java Day Tokyo 2015 6-3]
Java Concurrency, A(nother) Peek Under the Hood [Java Day Tokyo 2016 3-C]
Ahead-of-Time Compilation with JDK 9 [Java Day Tokyo 2017 D1-A1]
InvokeDynamic for Mere Mortals [JavaOne 2015 CON7682]
HotSpot Synchronization, A Peek Under the Hood [JavaOne 2015 CON7570]
Let’s Write Our Own Chip-8 Interpreter! [JavaOne 2017 CON3584]
Everything You Wanted to Know About JIT Compilation but Were Afraid to Ask [J...
Full Speed Ahead! (Ahead-of-Time Compilation for Java SE) [JavaOne 2017 CON3738]
OpenJDK: How to Join In on All the Fun [JavaOne 2017 CON3667]

Recently uploaded (20)

PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
L1 - Introduction to python Backend.pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
ISO 45001 Occupational Health and Safety Management System
PPTX
ai tools demonstartion for schools and inter college
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPT
Introduction Database Management System for Course Database
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Nekopoi APK 2025 free lastest update
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
AI in Product Development-omnex systems
PDF
System and Network Administraation Chapter 3
PPTX
history of c programming in notes for students .pptx
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Navsoft: AI-Powered Business Solutions & Custom Software Development
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
L1 - Introduction to python Backend.pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
ISO 45001 Occupational Health and Safety Management System
ai tools demonstartion for schools and inter college
How Creative Agencies Leverage Project Management Software.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Introduction Database Management System for Course Database
2025 Textile ERP Trends: SAP, Odoo & Oracle
Nekopoi APK 2025 free lastest update
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
AI in Product Development-omnex systems
System and Network Administraation Chapter 3
history of c programming in notes for students .pptx
Upgrade and Innovation Strategies for SAP ERP Customers

JDK Mission Control: Where We Are, Where We Are Going [Code One 2019]

  • 1. Copyright © 2019 Oracle and/or its affiliates.
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Safe Harbor Copyright © 2019 Oracle and/or its affiliates.
  • 3. JDK Mission Control: Where We Are, Where We Are Going Principal Member of Technical Staff Java Platform Group September 16, 2019 David Buck Copyright © 2019 Oracle and/or its affiliates.
  • 4. JVM Sustaining Engineer OpenJDK 8 Update Project Maintainer JavaOne Rock Star Co-author of Oracle WebLogic Server 11g 構築・運用ガイド @DavidBuckJP https://blogs.oracle.com/buck/ Who am I? David Buck (left)
  • 5. • Background / History • Building • Demo • Takaways Copyright © 2019 Oracle and/or its affiliates. Agenda
  • 6. Introduction to JDK Mission Control and JDK Flight Recorder [DEV2316] Marcus Hirt and Klara Ward Monday 16:00 Moscone South Room 202 Improving Observability in Your Application with JFR and JMC [DEV3460] Marcus Hirt and Mario Torre Tuesday 11:30 Moscone South Room 201 Java Flight Recorder: Black Box of Java Applications[DEV3957] Poonam Parhar Wednesday 12:30 Moscone South Room 203 Robotics on JDK 11? With Modules? Are You… [DEV2329] Marcus Hirt, Miro Wengner, and Robert Savage Wednesday 16:00 Moscone South Room 313 Four Productive Ways to Use Open Source JFR and JMC Revisited [DEV3118] Sven Reimers and Martin Klähn Thursday 11:15 Moscone South Room 304 Enhanced Java Flight Recorder at Alibaba [DEV3667] Sanhong Li, Fangxi Yin, and Guangyu Zhu Thursday 12:15 Moscone South Room 203 Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406] Hirofumi Iwasaki and Hiroaki Nakada Thursday 13:15 Moscone South Room 201
  • 7. Introduction to JDK Mission Control and JDK Flight Recorder [DEV2316] Marcus Hirt and Klara Ward Monday 16:00 Moscone South Room 202 Improving Observability in Your Application with JFR and JMC [DEV3460] Marcus Hirt and Mario Torre Tuesday 11:30 Moscone South Room 201 Java Flight Recorder: Black Box of Java Applications[DEV3957] Poonam Parhar Wednesday 12:30 Moscone South Room 203 Robotics on JDK 11? With Modules? Are You… [DEV2329] Marcus Hirt, Miro Wengner, and Robert Savage Wednesday 16:00 Moscone South Room 313 Four Productive Ways to Use Open Source JFR and JMC Revisited [DEV3118] Sven Reimers and Martin Klähn Thursday 11:15 Moscone South Room 304 Enhanced Java Flight Recorder at Alibaba [DEV3667] Sanhong Li, Fangxi Yin, and Guangyu Zhu Thursday 12:15 Moscone South Room 203 Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406] Hirofumi Iwasaki and Hiroaki Nakada Thursday 13:15 Moscone South Room 201
  • 9. Several Closely Related Technologies (JRockit / Java / JDK) Mission Control Flight Recording Oracle JDK: JDK 7 OpenJDK: JDK 11 JEP 167: Event-Based JVM Tracing (JDK 7) JEP 328: Flight Recorder (JDK 11)
  • 10. Flight Recorder Technology to generate and persist JVM event data Low-overhead Intended for use in production Viable for “always on” use-case
  • 11. Mission Control Eclipse-based (RCP) GUI tool Visualization of Flight Recording data Automated Flight Recording analysis JMX console for real-time monitoring (and control) of target Plug-in framework for additional functionality Support for integration into Eclipse IDE
  • 12. Mission Control Eclipse-based (RCP) GUI tool Visualization of Flight Recording data Automated Flight Recording analysis JMX console for real-time monitoring (and control) of target Plug-in framework for additional functionality Support for integration into Eclipse IDE
  • 14. Our Story Begins in Sweden By Holger.Ellgaard - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=5623391
  • 15. JRockit Developed by Stockholm-based Appeal Virtual Systems JIT-only JVM (no interpreter) Heavily focused on Intel (x86 / AMD64 / IA64) performance
  • 16. Value Add JRockit was originally sold as a “Virtual Machine for Java” Sun required each Java licensee to have a “value add” “Superior performance” didn’t go over well... JRockit’s monitoring and management tools were presented as its value add to differentiate itself from Sun’s offerings
  • 17. Alex Flury at English Wikipedia [Public domain]
  • 18. By VARA - Beeld- en Geluidwiki, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=49198465
  • 20. 2002
  • 23. 2008
  • 26. 2009
  • 29. A Combined Legacy JRockit’s best features ported over to HotSpot Diagnostic commands (JDK 7) Compiler control (JDK 9) Native memory tracking (JDK 7) Flight Recorder (JDK 7) Build system (behind the scenes) (JDK 8) JRockit Mission Control -> Java Mission Control
  • 31. JRockit Runtime Analyzer Based on experience gained while consulting “Cast a big net” to avoid multiple support iterations Most data collection piggy-backed onto internal JVM operations (low overhead) Data persisted at zipped XML
  • 34. JRockit Mission Control 4 Post Oracle acquisition (JRockit R28) Flight Recorder replaces JRockit Runtime Analyzer XML data -> binary data Much lower overhead to collect and persist data
  • 36. Flight Recorder in HotSpot Flight Recorder support added in 7u40 JMC 5 bundled with JDK
  • 37. JDK 7 JMC 5 JDK 8 JMC 5.5 JDK 9 JMC 6 JDK 10 JMC 6
  • 38. 2018
  • 39. JDK Mission Control 7 Open source No longer bundled with JDK (as of JDK 11) Flight Recorder implementation open sourced (as of JDK 11)
  • 40. Universal Permissive License Clear patent protection Clear & simplified relicensing Reduced overhead in source files It can be used as a contributor agreement See FAQ (link at end of slide deck) for details
  • 41. Universal Permissive License Clear patent protection Clear & simplified relicensing Reduced overhead in source files It can be used as a contributor agreement See FAQ (link at end of slide deck) for details
  • 42. Oracle Contributor Agreement Must be signed and sent to Oracle to contribute code to Mission Control Same requirement as other OpenJDK projects Only needs to be done once
  • 43. “...you're doing an awesome job in building a real community and a *very* open source project.“ - Red Hat Contributor to Marcus Hirt jmc-dev alias, November 8, 2018
  • 44. Compatibility Flight Recording format changes between JDK versions Mission Control has always been backwards compatible with flight recordings from older HotSpot releases. JDK 11 requires JMC 7 JMC 7 is currently the only version that supports all HotSpot based flight recordings
  • 47. OpenJDK JMC repositories jmc Mainline Development Branch jmc-graphics images / branding resources jmc7 JMC 7.0 branch Copyright © 2019 Oracle and/or its affiliates.
  • 48. GitHub Mirror Only mainline development branch Not in full sync at the moment Recommend using hg until project Skara migration * * Maybe...
  • 49. A Tale of Two Shells... Shell 1 cd releng/third-party mvn p2:site mvn jetty:run Shell 2 cd core mvn install cd .. mvn clean package
  • 50. A Tale of Two Shells... Equinox p2: provisioning platform for OSGi artifacts and meta-data Shell 1 sets up a p2 repository that hosts dependencies needed by the build process run in shell 2
  • 51. Cross Compilation?! Regardless of build platform, binaries for all three target platforms are generated Platform-dependent bits are downloaded as dependencies
  • 52. Building Quick and easy to do Builds virtually out of the box on most Linux distros Build platform does not need to match target platform
  • 53. Demo
  • 54. Safepoints Stop-the-World implementation Guarantees Java state of thread is known All threads executing Java code must stop JNI code can continue Cooperative suspension Polling based By YPLeroux at English Wikipedia, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=17734859
  • 55. Safepoints Stop-the-World implementation Guarantees Java state of thread is known All threads executing Java code must stop JNI code can continue Cooperative suspension Polling based By YPLeroux at English Wikipedia, CC BY 3.0, https://commons.wikimedia.org/w/index.php?curid=17734859
  • 56. Safepoint Polling Interpreter can stop instantly template dispatch table replaced “polling” is essentially free Explicit poll inserted into C1/C2 JIT output Global safepoint polling page in address space Poll implemented by attempted read of this address Safepoint triggered by change in page permissions
  • 57. JIT Safepoint Polling On return from method call Backend branches in most loops Any transition to native code (JVM / JNI)
  • 58. Collatz Conjecture Simple rules: If number is even, divide by 2 If number is odd, multiply by 3 and add 1 Conjecture: Start with any positive integer, and you’ll eventually end up at 1 An open problem in math
  • 59. Collatz Conjecture Examples 2 1 3 10 5 16 8 4 2 1 4 2 1 5 16 8 4 2 1 6 3 10 5 16 8 4 2 1 7 22 11 34 17 52 26 13 40 20 10 5 16 8...
  • 60. Collatz Conjecture Examples 2 1 3 10 5 16 8 4 2 1 4 2 1 5 16 8 4 2 1 6 3 10 5 16 8 4 2 1 7 22 11 34 17 52 26 13 40 20 10 5 16 8...
  • 61. Collatz Conjecture By Kunashmilovich - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=48786325
  • 62. Let’s test the Collatz Conjecture...
  • 63. Let’s test the Collatz Conjecture... the stupidest way imaginable!
  • 64. Testing the Collatz Conjecture private static long next(long num) { return (num%2 == 0) ? num / 2 : 3 * num + 1; }
  • 65. Testing the Collatz Conjecture public static void main(String[] args) { long num; for (int i=2; i < Integer.MAX_VALUE; i++) { num = i; for (int j=0; j < Integer.MAX_VALUE; j++) { num = next(num); if (num == 1) break; } if (num != 1) { System.out.println(i + " did not end at 1."); System.exit(-1); } else if (i % 1000000 == 0) { System.out.println("done with " + i); } } }
  • 66. Counted Loop Loop that increments / decrements an int index Worst case scenario, we loop 4 billion times (very short) HotSpot may not bother adding a safepoint pool to the loop
  • 67. Testing the Collatz Conjecture public static void main(String[] args) { long num; for (int i=2; i < Integer.MAX_VALUE; i++) { num = i; for (int j=0; j < Integer.MAX_VALUE; j++) { num = next(num); if (num == 1) break; } if (num != 1) { System.out.println(i + " did not end at 1."); System.exit(-1); } else if (i % 1000000 == 0) { System.out.println("done with " + i); } } }
  • 68. Testing the Collatz Conjecture public static void main(String[] args) { long num; for (int i=2; i < Integer.MAX_VALUE; i++) { num = i; for (int j=0; j < Integer.MAX_VALUE; j++) { num = next(num); if (num == 1) break; } if (num != 1) { System.out.println(i + " did not end at 1."); System.exit(-1); } else if (i % 1000000 == 0) { System.out.println("done with " + i); } } }
  • 69. Profiler Types Sampling Profiler Process sampled periodically Invocation count is not exact Observer effect should be negligible Invocation Counter Profiler Code is instrumented Exact number of invocations Observer effect often distorts results
  • 70. Profiler Types Sampling Profiler Process sampled periodically Invocation count is not exact Observer effect should be negligible Invocation Counter Profiler Code is instrumented Exact number of invocations Observer effect often distorts results
  • 71. Traditional Sampler JVMTI / Bytecode instrumentation can only stop thread at a safepoint poll What happens between safpoint polls is invisible to the profiler
  • 74. Flight Recording Can asynchronously stop execution thread at any time No dependence on safe points for profiling HotSpot internal API (AsyncGetCallTrace) Honest Profiler Oracle Developer Studio
  • 76. What happened? Safepoints have corresponding metadata Byte Code Index (bci) Liveness data (what stack positions point to Java heap)
  • 77. What happened? By default, metadata is normally only generated for safepoints DebugNonSafepoints flag forces metadata generation for all code (obvious performance cost)
  • 80. Takeaways Open sourcing of JMC has been a great success JMC 7 and higher are the ideal MC to use regardless of JDK version Binary builds from Oracle should be available in the near future JMC is simple to build on your own today Flight Recording’s AsyncGetCallTrace-based profiling can provide a level of accuracy unachievable by most other tools.
  • 82. References Marcus Hirt’s Blog http://hirt.se/blog/ The Universal Permissive License (UPL) https://oss.oracle.com/licenses/upl/
  • 83. Session Survey Help us make the content even better. Please complete the session survey in the Mobile App. Copyright © 2019 Oracle and/or its affiliates.
  • 84. The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties. A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Safe Harbor Copyright © 2019 Oracle and/or its affiliates.