SlideShare a Scribd company logo
1 of 34
Download to read offline
Java Mission Control &
Java Flight Recorder
M. ISURU T. C. PERERA
1
@chrishantha
Agenda
 Tools in Java Development Kit
 What is Java Mission Control (JMC)
 Java Flight Recorder (JFR)
 Demos
04/12/2014Java Colombo Meetup
2
JDK Tools
• Basic Tools (java, javac,
jar)
• Security Tools (jarsigner,
keytool)
• Java Web Service Tools
(wsimport, wsgen)
• Java Troubleshooting,
Profiling, Monitoring and
Management Tools (jcmd,
jconsole, jmc, jvisualvm)
04/12/2014Java Colombo Meetup
3
Image Source:
http://commons.wikimedia.org/wiki/File:Hand_tools.jpg
Java Troubleshooting, Profiling,
Monitoring and Management Tools
 jcmd - JVM Diagnostic Commands tool
 jconsole - A JMX-compliant graphical tool for monitoring a Java
application
 jvisualvm – Provides detailed information about the Java application. It
provides CPU & Memory profiling, heap dump analysis, memory leak
detection etc.
 jmc – Tools to monitor and manage Java applications without introducing
performance overhead
04/12/2014Java Colombo Meetup
4
Java Experimental Tools
 Monitoring Tools
 jps – JVM Process Status Tool
 jstat – JVM Statistics Monitoring Tool
 Troubleshooting Tools
 jmap - Memory Map for Java
 jhat - Heap Dump Browser
 jstack – Stack Trace for Java
04/12/2014Java Colombo Meetup
5
What is Java Mission Control?
 A set of powerful tools running on the Oracle JDK to
monitor and manage Java applications
 Free for development use (Oracle Binary Code License)
 Available in JDK since Java 7 update 40
 Supports Plugins
 Two main tools
 JMX Console
 Java Flight Recorder
04/12/2014Java Colombo Meetup
6
Starting Java Mission Control
 Run “jmc” command in $JAVA_HOME/bin
 It runs on Eclipse
 It can also be installed on your existing Eclipse
04/12/2014Java Colombo Meetup
7
Troubleshooting Tip
 If “jmc” crashes with SIGSEGV on Ubuntu, try following
 sudo -E sh -c 'echo org.eclipse.swt.browser.DefaultType=mozilla >>
$JAVA_HOME/lib/missioncontrol/configuration/config.ini'
04/12/2014Java Colombo Meetup
8
Java Process Browser
 Uses the Java Discovery Protocol (JDP).
 Allows to list and connect to both locally and remotely running Java
applications.
 JMC provides full secure access with encrypted communication and
configurable user access restrictions.
04/12/2014Java Colombo Meetup
9
JMX Console
 A tool for monitoring and managing multiple Oracle JDK instances via JMX
interface
 Captures and presents live data about:
 Garbage Collection (GC) Pauses
 Memory (Heap Usage)
 CPU Usage
 Other attributes exposes via MBeans
 Provides triggers that can monitor MBeans and trigger an action
04/12/2014Java Colombo Meetup
10
JMX Console
04/12/2014Java Colombo Meetup
11
JMX Console Tabs
 Overview – Dashboard, Graphs with real-time usage statistics
 System – Information about the JVM
 Memory – Monitor heap usage, garbage collection & active memory
pools
 Threads – Live thread usage by the application
 MBean Browser – Access all registered MBeans
 Triggers – Manage rules that trigger events
 Diagnostic Commands – Execute commands on JVM
04/12/2014Java Colombo Meetup
12
JMX Console Demo
 Sample applications from Marcus Hirt’s Tutorials
(http://hirt.se/blog/?p=611)
 Demonstrating
 CPU Usage viewing in JMC
 View deadlocked threads
04/12/2014Java Colombo Meetup
13
Image Source: https://duke.kenai.com/boxer/boxer.gif
Flight Recorder
 “Black box” used in aircraft
04/12/2014Java Colombo Meetup
14
Image Source: http://commons.wikimedia.org/wiki/File:Black_box.aeroplane.JPG
Java Flight Recorder
 A profiling and event collection framework built into the Oracle JDK
 Gather low level information about the JVM and application are behaving
without performance impact (less than 2%)
 Always on Profiling in Production Environments
 Engine was released with Java 7 update 4
04/12/2014Java Colombo Meetup
15
Data Collection
 JFR stores data in a hierarchy of in-memory buffers.
 The data is moved to the disk when the buffers are full
 Initially the JFR stores data in thread-local buffers. (Improves throughput,
no synchronization for every event)
 Once the thread-local buffer has been filled, the data is transferred to a
global buffer. (Requires synchronization)
 After the buffers are full, the data is written to the disk
04/12/2014Java Colombo Meetup
16
Data Analysis
 JFR Plugin in JMC provides dynamic and in-depth analysis of all collected
JFR data.
 JFR enables users to analyze all aspects of a Java application
 Can analyze the Code, Memory, Threads, Locks and I/O
04/12/2014Java Colombo Meetup
17
Type of Events in JFR
 Instant events – Events with only one time
 Requestable events – Events with a user configurable period
 Duration events – Event with a start and end time
 Timed events – Duration events with a user configurable threshold
04/12/2014Java Colombo Meetup
18
JFR Recoding Types
 Time Fixed Recordings
 Fixed duration
 The recording will be opened automatically in JMC at the end(If the recording
was started by JMC)
 Continuous Recordings
 No end time
 Must be explicitly dumped
04/12/2014Java Colombo Meetup
19
Enabling Java Flight Recorder
 The server VM needs to be started with following options
 -XX:+UnlockCommercialFeatures -XX:+FlightRecorder
 Make sure to use JDK 7u40 or later
 For remote monitoring, start with appropriate com.sun.management flags
04/12/2014Java Colombo Meetup
20
Flight Recording from JMC
 Right click on JVM and select “Start Flight Recording”
 Select the type of recording: Time fixed / Continuous
 Select the flight recording template
 Modify the event options for the selected flight recording template
(Optional)
 Modify the event details (Optional)
04/12/2014Java Colombo Meetup
21
Start Flight Recording Wizard
04/12/2014Java Colombo Meetup
22
Event Options for Profiling
04/12/2014Java Colombo Meetup
23
Event Details for Profiling
04/12/2014Java Colombo Meetup
24
Flight Recording using startup flags
 To produce a Flight Recording from the command line, you can use “-
XX:StartFlightRecording” option. For example
 -
XX:StartFlightRecording=delay=20s,duration=60s,name=Test,filename=recording.
jfr,settings=profile
 Setting are in $JAVA_HOME/jre/lib/jfr
 Use following to change log level
 -XX:FlightRecorderOptions=loglevel=info
04/12/2014Java Colombo Meetup
25
The Default Recording
 Use default recording option to start a continuous recording
 -XX:FlightRecorderOptions=defaultrecording=true
 Default recording can be dumped on exit
 Only the default recording can be used with the dumponexit and
dumponexitpath parameters
 -
XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexit
path=/tmp/dumponexit.jfr
04/12/2014Java Colombo Meetup
26
Creating Recording with “jcmd”
command
 The command “jcmd” can also be used to start flight recording
 Start Recording Example:
 jcmd <pid> JFR.start delay=20s duration=60s name=MyRecording
filename=/tmp/recording.jfr settings=profile
 Check recording
 jcmd <pid> JFR.check
 Dump Recording
 jcmd <pid> JFR.dump filename=/tmp/dump.jfr name=MyRecording
04/12/2014Java Colombo Meetup
27
Analyzing Flight Recordings
 JFR runtime engine dumps recorded data to files with *.jfr extension
 These binary files can be viewed from JMC client
 There are tab groups showing certain aspects of the JVM and the Java
application runtime such as Memory, Threads, I/O etc.
04/12/2014Java Colombo Meetup
28
Analyzing Flight Recordings
04/12/2014Java Colombo Meetup
29
JFR Tab Groups
 General – Details of the JVM, the system, and the recording.
 Memory - Information about memory & garbage collection.
 Code - Information about methods, exceptions, compilations, and class
loading.
 Threads - Information about threads and locks.
 I/O: Information about file and socket I/O.
 System: Information about environment
 Events: Information about the event types in the recording
04/12/2014Java Colombo Meetup
30
Operative Set
 A global set of events
 Events can be added or removed from the context menu
 A check box is used to show events in the operative set
04/12/2014Java Colombo Meetup
31
Flight Recording Demo
 Time fixed & continuous recordings
 Analyzing
04/12/2014Java Colombo Meetup
32
Image Source: https://duke.kenai.com/gun/Gun.jpg
References
 Java Mission Control
 Marcus Hirt’s Blog
 Advanced Java Diagnostics and Monitoring Without Performance
Overhead - Oracle Whitepaper
 Oracle Java SE Advanced
 InfoQ - Mission Control and Flight Recorder on HotSpot JVM
 JMC & JFR - Diagnostic Tools
 JDK Development Tools
 Java Mission Control and Flight Recorder Demo Series
04/12/2014Java Colombo Meetup
33
Thank you!
04/12/2014Java Colombo Meetup
34
Image Source: https://duke.kenai.com/animations/DukeTuxChristmas.gif

More Related Content

What's hot

JMC/JFR: Kotlin spezial
JMC/JFR: Kotlin spezialJMC/JFR: Kotlin spezial
JMC/JFR: Kotlin spezialMiro Wengner
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoringSimon Ritter
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsIsuru Perera
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyLinaro
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame GraphsIsuru Perera
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the BoxMarcus Hirt
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java WorkshopSimon Ritter
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & ProfilingIsuru Perera
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...InfinIT - Innovationsnetværket for it
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time JavaDeniz Oguz
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Dinakar Guniguntala
 
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...Zhenyun Zhuang
 
OS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsOS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsZhenyun Zhuang
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsBrendan Gregg
 
Best Practices for performance evaluation and diagnosis of Java Applications ...
Best Practices for performance evaluation and diagnosis of Java Applications ...Best Practices for performance evaluation and diagnosis of Java Applications ...
Best Practices for performance evaluation and diagnosis of Java Applications ...IndicThreads
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunningguest1f2740
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvmPrem Kuppumani
 
Memory management in Andoid
Memory management in AndoidMemory management in Andoid
Memory management in AndoidMonkop Inc
 
Java black box profiling JUG.EKB 2016
Java black box profiling JUG.EKB 2016Java black box profiling JUG.EKB 2016
Java black box profiling JUG.EKB 2016aragozin
 
PowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAPowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAAlexander Grudanov
 

What's hot (20)

JMC/JFR: Kotlin spezial
JMC/JFR: Kotlin spezialJMC/JFR: Kotlin spezial
JMC/JFR: Kotlin spezial
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
Software Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and FlamegraphsSoftware Profiling: Java Performance, Profiling and Flamegraphs
Software Profiling: Java Performance, Profiling and Flamegraphs
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case study
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame Graphs
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the Box
 
Modern Java Workshop
Modern Java WorkshopModern Java Workshop
Modern Java Workshop
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...Towards "write once - run whenever possible" with Safety Critical Java af Ben...
Towards "write once - run whenever possible" with Safety Critical Java af Ben...
 
Introduction to Real Time Java
Introduction to Real Time JavaIntroduction to Real Time Java
Introduction to Real Time Java
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
 
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...
Eliminating OS-caused Large JVM Pauses for Latency-sensitive Java-based Cloud...
 
OS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsOS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutions
 
USENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame GraphsUSENIX ATC 2017: Visualizing Performance with Flame Graphs
USENIX ATC 2017: Visualizing Performance with Flame Graphs
 
Best Practices for performance evaluation and diagnosis of Java Applications ...
Best Practices for performance evaluation and diagnosis of Java Applications ...Best Practices for performance evaluation and diagnosis of Java Applications ...
Best Practices for performance evaluation and diagnosis of Java Applications ...
 
Jvm Performance Tunning
Jvm Performance TunningJvm Performance Tunning
Jvm Performance Tunning
 
Performance tuning jvm
Performance tuning jvmPerformance tuning jvm
Performance tuning jvm
 
Memory management in Andoid
Memory management in AndoidMemory management in Andoid
Memory management in Andoid
 
Java black box profiling JUG.EKB 2016
Java black box profiling JUG.EKB 2016Java black box profiling JUG.EKB 2016
Java black box profiling JUG.EKB 2016
 
PowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDAPowerDRC/LVS 2.0.1 released by POLYTEDA
PowerDRC/LVS 2.0.1 released by POLYTEDA
 

Similar to Java Colombo Meetup: Java Mission Control & Java Flight Recorder

ASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdfASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdfMiro Wengner
 
DevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight RecorderDevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight RecorderMiro Wengner
 
Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.Alexandre (Shura) Iline
 
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...Jeffrey West
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and ProfilingWSO2
 
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
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsDror Bereznitsky
 
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Rafael Monteiro e Pereira
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdfAna-Maria Mihalceanu
 
02-Java Technology Details.ppt
02-Java Technology Details.ppt02-Java Technology Details.ppt
02-Java Technology Details.pptJyothiAmpally
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversRajKumar Rampelli
 
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]Hiroaki NAKADA
 
JavaPerformanceChapter_5
JavaPerformanceChapter_5JavaPerformanceChapter_5
JavaPerformanceChapter_5Saurav Basu
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityDanHeidinga
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data ServicesTom Kranz
 

Similar to Java Colombo Meetup: Java Mission Control & Java Flight Recorder (20)

ASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdfASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdf
 
DevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight RecorderDevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight Recorder
 
Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.Java code coverage with JCov. Implementation details and use cases.
Java code coverage with JCov. Implementation details and use cases.
 
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...
WebLogic Developer Webcast 5: Troubleshooting and Testing with WebLogic, Soap...
 
Troubleshooting Tools In JDK
Troubleshooting Tools In JDKTroubleshooting Tools In JDK
Troubleshooting Tools In JDK
 
Java Performance and Profiling
Java Performance and ProfilingJava Performance and Profiling
Java Performance and Profiling
 
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
 
Jdk Tools For Performance Diagnostics
Jdk Tools For Performance DiagnosticsJdk Tools For Performance Diagnostics
Jdk Tools For Performance Diagnostics
 
Embrace the JVM
Embrace the JVMEmbrace the JVM
Embrace the JVM
 
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA Inside the JVM - Performance & Garbage Collector Tuning in JAVA
Inside the JVM - Performance & Garbage Collector Tuning in JAVA
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
A Glance At The Java Performance Toolbox.pdf
 A Glance At The Java Performance Toolbox.pdf A Glance At The Java Performance Toolbox.pdf
A Glance At The Java Performance Toolbox.pdf
 
02-Java Technology Details.ppt
02-Java Technology Details.ppt02-Java Technology Details.ppt
02-Java Technology Details.ppt
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Introduction to Kernel and Device Drivers
Introduction to Kernel and Device DriversIntroduction to Kernel and Device Drivers
Introduction to Kernel and Device Drivers
 
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
Performance Monitoring with Java Flight Recorder on OpenJDK [DEV2406]
 
JavaPerformanceChapter_5
JavaPerformanceChapter_5JavaPerformanceChapter_5
JavaPerformanceChapter_5
 
A Glance At The Java Performance Toolbox
 A Glance At The Java Performance Toolbox A Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
JavaOne 2016: Life after Modularity
JavaOne 2016: Life after ModularityJavaOne 2016: Life after Modularity
JavaOne 2016: Life after Modularity
 
Custom Buildpacks and Data Services
Custom Buildpacks and Data ServicesCustom Buildpacks and Data Services
Custom Buildpacks and Data Services
 

More from Isuru Perera

Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight ProcessesIsuru Perera
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaIsuru Perera
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Isuru Perera
 
Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10Isuru Perera
 
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsApache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsIsuru Perera
 

More from Isuru Perera (7)

Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight Processes
 
Java in flames
Java in flamesJava in flames
Java in flames
 
Software Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in JavaSoftware Profiling: Understanding Java Performance and how to profile in Java
Software Profiling: Understanding Java Performance and how to profile in Java
 
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
Unified Modeling Language (UML), Object-Oriented Programming Concepts & Desig...
 
Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10Building your own PaaS using Apache Stratos - Webinar 2014-04-10
Building your own PaaS using Apache Stratos - Webinar 2014-04-10
 
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI InternalsApache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
 
Cloud foundry
Cloud foundryCloud foundry
Cloud foundry
 

Recently uploaded

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Java Colombo Meetup: Java Mission Control & Java Flight Recorder

  • 1. Java Mission Control & Java Flight Recorder M. ISURU T. C. PERERA 1 @chrishantha
  • 2. Agenda  Tools in Java Development Kit  What is Java Mission Control (JMC)  Java Flight Recorder (JFR)  Demos 04/12/2014Java Colombo Meetup 2
  • 3. JDK Tools • Basic Tools (java, javac, jar) • Security Tools (jarsigner, keytool) • Java Web Service Tools (wsimport, wsgen) • Java Troubleshooting, Profiling, Monitoring and Management Tools (jcmd, jconsole, jmc, jvisualvm) 04/12/2014Java Colombo Meetup 3 Image Source: http://commons.wikimedia.org/wiki/File:Hand_tools.jpg
  • 4. Java Troubleshooting, Profiling, Monitoring and Management Tools  jcmd - JVM Diagnostic Commands tool  jconsole - A JMX-compliant graphical tool for monitoring a Java application  jvisualvm – Provides detailed information about the Java application. It provides CPU & Memory profiling, heap dump analysis, memory leak detection etc.  jmc – Tools to monitor and manage Java applications without introducing performance overhead 04/12/2014Java Colombo Meetup 4
  • 5. Java Experimental Tools  Monitoring Tools  jps – JVM Process Status Tool  jstat – JVM Statistics Monitoring Tool  Troubleshooting Tools  jmap - Memory Map for Java  jhat - Heap Dump Browser  jstack – Stack Trace for Java 04/12/2014Java Colombo Meetup 5
  • 6. What is Java Mission Control?  A set of powerful tools running on the Oracle JDK to monitor and manage Java applications  Free for development use (Oracle Binary Code License)  Available in JDK since Java 7 update 40  Supports Plugins  Two main tools  JMX Console  Java Flight Recorder 04/12/2014Java Colombo Meetup 6
  • 7. Starting Java Mission Control  Run “jmc” command in $JAVA_HOME/bin  It runs on Eclipse  It can also be installed on your existing Eclipse 04/12/2014Java Colombo Meetup 7
  • 8. Troubleshooting Tip  If “jmc” crashes with SIGSEGV on Ubuntu, try following  sudo -E sh -c 'echo org.eclipse.swt.browser.DefaultType=mozilla >> $JAVA_HOME/lib/missioncontrol/configuration/config.ini' 04/12/2014Java Colombo Meetup 8
  • 9. Java Process Browser  Uses the Java Discovery Protocol (JDP).  Allows to list and connect to both locally and remotely running Java applications.  JMC provides full secure access with encrypted communication and configurable user access restrictions. 04/12/2014Java Colombo Meetup 9
  • 10. JMX Console  A tool for monitoring and managing multiple Oracle JDK instances via JMX interface  Captures and presents live data about:  Garbage Collection (GC) Pauses  Memory (Heap Usage)  CPU Usage  Other attributes exposes via MBeans  Provides triggers that can monitor MBeans and trigger an action 04/12/2014Java Colombo Meetup 10
  • 12. JMX Console Tabs  Overview – Dashboard, Graphs with real-time usage statistics  System – Information about the JVM  Memory – Monitor heap usage, garbage collection & active memory pools  Threads – Live thread usage by the application  MBean Browser – Access all registered MBeans  Triggers – Manage rules that trigger events  Diagnostic Commands – Execute commands on JVM 04/12/2014Java Colombo Meetup 12
  • 13. JMX Console Demo  Sample applications from Marcus Hirt’s Tutorials (http://hirt.se/blog/?p=611)  Demonstrating  CPU Usage viewing in JMC  View deadlocked threads 04/12/2014Java Colombo Meetup 13 Image Source: https://duke.kenai.com/boxer/boxer.gif
  • 14. Flight Recorder  “Black box” used in aircraft 04/12/2014Java Colombo Meetup 14 Image Source: http://commons.wikimedia.org/wiki/File:Black_box.aeroplane.JPG
  • 15. Java Flight Recorder  A profiling and event collection framework built into the Oracle JDK  Gather low level information about the JVM and application are behaving without performance impact (less than 2%)  Always on Profiling in Production Environments  Engine was released with Java 7 update 4 04/12/2014Java Colombo Meetup 15
  • 16. Data Collection  JFR stores data in a hierarchy of in-memory buffers.  The data is moved to the disk when the buffers are full  Initially the JFR stores data in thread-local buffers. (Improves throughput, no synchronization for every event)  Once the thread-local buffer has been filled, the data is transferred to a global buffer. (Requires synchronization)  After the buffers are full, the data is written to the disk 04/12/2014Java Colombo Meetup 16
  • 17. Data Analysis  JFR Plugin in JMC provides dynamic and in-depth analysis of all collected JFR data.  JFR enables users to analyze all aspects of a Java application  Can analyze the Code, Memory, Threads, Locks and I/O 04/12/2014Java Colombo Meetup 17
  • 18. Type of Events in JFR  Instant events – Events with only one time  Requestable events – Events with a user configurable period  Duration events – Event with a start and end time  Timed events – Duration events with a user configurable threshold 04/12/2014Java Colombo Meetup 18
  • 19. JFR Recoding Types  Time Fixed Recordings  Fixed duration  The recording will be opened automatically in JMC at the end(If the recording was started by JMC)  Continuous Recordings  No end time  Must be explicitly dumped 04/12/2014Java Colombo Meetup 19
  • 20. Enabling Java Flight Recorder  The server VM needs to be started with following options  -XX:+UnlockCommercialFeatures -XX:+FlightRecorder  Make sure to use JDK 7u40 or later  For remote monitoring, start with appropriate com.sun.management flags 04/12/2014Java Colombo Meetup 20
  • 21. Flight Recording from JMC  Right click on JVM and select “Start Flight Recording”  Select the type of recording: Time fixed / Continuous  Select the flight recording template  Modify the event options for the selected flight recording template (Optional)  Modify the event details (Optional) 04/12/2014Java Colombo Meetup 21
  • 22. Start Flight Recording Wizard 04/12/2014Java Colombo Meetup 22
  • 23. Event Options for Profiling 04/12/2014Java Colombo Meetup 23
  • 24. Event Details for Profiling 04/12/2014Java Colombo Meetup 24
  • 25. Flight Recording using startup flags  To produce a Flight Recording from the command line, you can use “- XX:StartFlightRecording” option. For example  - XX:StartFlightRecording=delay=20s,duration=60s,name=Test,filename=recording. jfr,settings=profile  Setting are in $JAVA_HOME/jre/lib/jfr  Use following to change log level  -XX:FlightRecorderOptions=loglevel=info 04/12/2014Java Colombo Meetup 25
  • 26. The Default Recording  Use default recording option to start a continuous recording  -XX:FlightRecorderOptions=defaultrecording=true  Default recording can be dumped on exit  Only the default recording can be used with the dumponexit and dumponexitpath parameters  - XX:FlightRecorderOptions=defaultrecording=true,dumponexit=true,dumponexit path=/tmp/dumponexit.jfr 04/12/2014Java Colombo Meetup 26
  • 27. Creating Recording with “jcmd” command  The command “jcmd” can also be used to start flight recording  Start Recording Example:  jcmd <pid> JFR.start delay=20s duration=60s name=MyRecording filename=/tmp/recording.jfr settings=profile  Check recording  jcmd <pid> JFR.check  Dump Recording  jcmd <pid> JFR.dump filename=/tmp/dump.jfr name=MyRecording 04/12/2014Java Colombo Meetup 27
  • 28. Analyzing Flight Recordings  JFR runtime engine dumps recorded data to files with *.jfr extension  These binary files can be viewed from JMC client  There are tab groups showing certain aspects of the JVM and the Java application runtime such as Memory, Threads, I/O etc. 04/12/2014Java Colombo Meetup 28
  • 30. JFR Tab Groups  General – Details of the JVM, the system, and the recording.  Memory - Information about memory & garbage collection.  Code - Information about methods, exceptions, compilations, and class loading.  Threads - Information about threads and locks.  I/O: Information about file and socket I/O.  System: Information about environment  Events: Information about the event types in the recording 04/12/2014Java Colombo Meetup 30
  • 31. Operative Set  A global set of events  Events can be added or removed from the context menu  A check box is used to show events in the operative set 04/12/2014Java Colombo Meetup 31
  • 32. Flight Recording Demo  Time fixed & continuous recordings  Analyzing 04/12/2014Java Colombo Meetup 32 Image Source: https://duke.kenai.com/gun/Gun.jpg
  • 33. References  Java Mission Control  Marcus Hirt’s Blog  Advanced Java Diagnostics and Monitoring Without Performance Overhead - Oracle Whitepaper  Oracle Java SE Advanced  InfoQ - Mission Control and Flight Recorder on HotSpot JVM  JMC & JFR - Diagnostic Tools  JDK Development Tools  Java Mission Control and Flight Recorder Demo Series 04/12/2014Java Colombo Meetup 33
  • 34. Thank you! 04/12/2014Java Colombo Meetup 34 Image Source: https://duke.kenai.com/animations/DukeTuxChristmas.gif