SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Great tools in Java Development Kit 
05 November 2014 
Senior Software Engineer 
M. Isuru Tharanga Chrishantha Perera 
Using Java Mission Control & Java Flight Recorder
2 
Agenda 
๏What is Java Mission Control (JMC) 
๏Java Flight Recorder (JFR) 
๏Using JMC 
๏Demos
What is Java Mission Control? 
๏A set of powerful tools running on the Oracle JDK to monitor and manage Java applications 
๏Less performance overhead 
๏Free for development use (Oracle Binary Code License) 
๏Available in JDK since Java 7 update 40 
๏Two main tools: JMX Console & JFR 
๏Supports Plugins 
3
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. 
4
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 Mbeansand trigger an action 
5
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 
๏It’s like the “black box” used in aircraft 
6
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 
7
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 
8
Type of Events in JFR 
๏Instant events –Events with only one time 
๏Requestableevents –Events with a user configurable period 
๏Duration events –Event with a start and end time 
๏Timed events –Duration events with a user configurable threshold 
9
Starting Java Mission Control 
๏Run “jmc” command in $JAVA_HOME/bin 
๏It runs on Eclipse 
๏It can also be installed on your existing Eclipse 
๏If it 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' 
10
JMC Overview 
11
Enabling Java Flight Recorder 
๏The server VM needs to be started with following options 
๏-XX:+UnlockCommercialFeatures-XX:+FlightRecorder 
๏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=d.jfr,settings=profile 
๏Use following to change log level 
๏-XX:FlightRecorderOptions=loglevel=info 
๏The command “jcmd” can also be used 
12
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) 
13
Start Flight Recording Wizard 
14
Event Options for Profiling 
15
Event Details for Profiling 
16
Demo 
๏Enable JFR in WSO2 ESB 
๏Sample applications from Marcus Hirt’sTutorials (http://hirt.se/blog/?p=611) to demonstrate: 
๏CPU Usage viewing in JMC 
๏How to view deadlocked threads in JMC 
๏Flight recording and observing Memory/Garbage Collections tab 
17
References 
๏Java Mission Control 
๏Marcus Hirt’sBlog 
๏Advanced Java Diagnostics and Monitoring Without Performance Overhead -Oracle Whitepaper 
๏Oracle Java SE Advanced 
๏InfoQ-Mission Control and Flight Recorder on HotSpotJVM 
๏JMC & JFR -Diagnostic Tools 
18
Contact us !

Más contenido relacionado

La actualidad más candente

JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
Vladimir Ivanov
 
Servlet sessions
Servlet sessionsServlet sessions
Servlet sessions
vantinhkhuc
 
Android audio system(pcm데이터출력준비-서비스서버)
Android audio system(pcm데이터출력준비-서비스서버)Android audio system(pcm데이터출력준비-서비스서버)
Android audio system(pcm데이터출력준비-서비스서버)
fefe7270
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
guest11106b
 

La actualidad más candente (20)

Linux Instrumentation
Linux InstrumentationLinux Instrumentation
Linux Instrumentation
 
Java Flight Recorder Behind the Scenes
Java Flight Recorder Behind the ScenesJava Flight Recorder Behind the Scenes
Java Flight Recorder Behind the Scenes
 
ClassLoader Leaks
ClassLoader LeaksClassLoader Leaks
ClassLoader Leaks
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
JPA and Hibernate
JPA and HibernateJPA and Hibernate
JPA and Hibernate
 
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
Hardware-assisted Isolated Execution Environment to run trusted OS and applic...
 
Debugging Android Native Library
Debugging Android Native LibraryDebugging Android Native Library
Debugging Android Native Library
 
JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013JVM JIT-compiler overview @ JavaOne Moscow 2013
JVM JIT-compiler overview @ JavaOne Moscow 2013
 
Fun with Network Interfaces
Fun with Network InterfacesFun with Network Interfaces
Fun with Network Interfaces
 
Let's talk about Garbage Collection
Let's talk about Garbage CollectionLet's talk about Garbage Collection
Let's talk about Garbage Collection
 
Servlet sessions
Servlet sessionsServlet sessions
Servlet sessions
 
Android audio system(pcm데이터출력준비-서비스서버)
Android audio system(pcm데이터출력준비-서비스서버)Android audio system(pcm데이터출력준비-서비스서버)
Android audio system(pcm데이터출력준비-서비스서버)
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Hands-On Java web passando por Servlets, JSP, JSTL, JDBC, Hibernate, DAO, MV...
Hands-On Java web passando por  Servlets, JSP, JSTL, JDBC, Hibernate, DAO, MV...Hands-On Java web passando por  Servlets, JSP, JSTL, JDBC, Hibernate, DAO, MV...
Hands-On Java web passando por Servlets, JSP, JSTL, JDBC, Hibernate, DAO, MV...
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 

Similar a Using Java Mission Control & Java Flight Recorder

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
 

Similar a Using Java Mission Control & Java Flight Recorder (20)

Java Colombo Meetup: Java Mission Control & Java Flight Recorder
Java Colombo Meetup: Java Mission Control & Java Flight RecorderJava Colombo Meetup: Java Mission Control & Java Flight Recorder
Java Colombo Meetup: Java Mission Control & Java Flight Recorder
 
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]
 
DevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight RecorderDevDays: Profiling With Java Flight Recorder
DevDays: Profiling With Java Flight Recorder
 
ASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdfASML_FlightRecorderMeetsJava.pdf
ASML_FlightRecorderMeetsJava.pdf
 
Tools in action jdk mission control and flight recorder
Tools in action  jdk mission control and flight recorderTools in action  jdk mission control and flight recorder
Tools in action jdk mission control and flight recorder
 
Java performance monitoring
Java performance monitoringJava performance monitoring
Java performance monitoring
 
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
 
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...
 
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
 
使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder使ってみよう!JDK Flight Recorder
使ってみよう!JDK Flight Recorder
 
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
 
JFR Java Flight REcorder CON10912_UsingJFR.pptx
JFR Java Flight REcorder CON10912_UsingJFR.pptxJFR Java Flight REcorder CON10912_UsingJFR.pptx
JFR Java Flight REcorder CON10912_UsingJFR.pptx
 
Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40Java Mission Control in Java SE 7U40
Java Mission Control in Java SE 7U40
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
A Glance At The Java Performance Toolbox-TIA.pdf
 A Glance At The Java Performance Toolbox-TIA.pdf A Glance At The Java Performance Toolbox-TIA.pdf
A Glance At The Java Performance Toolbox-TIA.pdf
 
Ad111
Ad111Ad111
Ad111
 
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
AD111 -- Harnessing the Power of Server-Side JavaScript and Other Advanced XP...
 
Troubleshooting Tools In JDK
Troubleshooting Tools In JDKTroubleshooting Tools In JDK
Troubleshooting Tools In JDK
 
Profiling Java inside containers with ContainerJFR | DevNation Tech Talk
Profiling Java inside containers with ContainerJFR | DevNation Tech TalkProfiling Java inside containers with ContainerJFR | DevNation Tech Talk
Profiling Java inside containers with ContainerJFR | DevNation Tech Talk
 

Más de Isuru Perera

Java in flames
Java in flamesJava in flames
Java in flames
Isuru Perera
 

Más de Isuru Perera (11)

Java Threads: Lightweight Processes
Java Threads: Lightweight ProcessesJava Threads: Lightweight Processes
Java Threads: Lightweight Processes
 
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
 
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
 
Using Flame Graphs
Using Flame GraphsUsing Flame Graphs
Using Flame Graphs
 
Java Performance and Using Java Flight Recorder
Java Performance and Using Java Flight RecorderJava Performance and Using Java Flight Recorder
Java Performance and Using Java Flight Recorder
 
Java Performance & Profiling
Java Performance & ProfilingJava Performance & Profiling
Java Performance & Profiling
 
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
 

Último

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
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
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
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
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 

Using Java Mission Control & Java Flight Recorder

  • 1. Great tools in Java Development Kit 05 November 2014 Senior Software Engineer M. Isuru Tharanga Chrishantha Perera Using Java Mission Control & Java Flight Recorder
  • 2. 2 Agenda ๏What is Java Mission Control (JMC) ๏Java Flight Recorder (JFR) ๏Using JMC ๏Demos
  • 3. What is Java Mission Control? ๏A set of powerful tools running on the Oracle JDK to monitor and manage Java applications ๏Less performance overhead ๏Free for development use (Oracle Binary Code License) ๏Available in JDK since Java 7 update 40 ๏Two main tools: JMX Console & JFR ๏Supports Plugins 3
  • 4. 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. 4
  • 5. 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 Mbeansand trigger an action 5
  • 6. 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 ๏It’s like the “black box” used in aircraft 6
  • 7. 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 7
  • 8. 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 8
  • 9. Type of Events in JFR ๏Instant events –Events with only one time ๏Requestableevents –Events with a user configurable period ๏Duration events –Event with a start and end time ๏Timed events –Duration events with a user configurable threshold 9
  • 10. Starting Java Mission Control ๏Run “jmc” command in $JAVA_HOME/bin ๏It runs on Eclipse ๏It can also be installed on your existing Eclipse ๏If it 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' 10
  • 12. Enabling Java Flight Recorder ๏The server VM needs to be started with following options ๏-XX:+UnlockCommercialFeatures-XX:+FlightRecorder ๏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=d.jfr,settings=profile ๏Use following to change log level ๏-XX:FlightRecorderOptions=loglevel=info ๏The command “jcmd” can also be used 12
  • 13. 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) 13
  • 15. Event Options for Profiling 15
  • 16. Event Details for Profiling 16
  • 17. Demo ๏Enable JFR in WSO2 ESB ๏Sample applications from Marcus Hirt’sTutorials (http://hirt.se/blog/?p=611) to demonstrate: ๏CPU Usage viewing in JMC ๏How to view deadlocked threads in JMC ๏Flight recording and observing Memory/Garbage Collections tab 17
  • 18. References ๏Java Mission Control ๏Marcus Hirt’sBlog ๏Advanced Java Diagnostics and Monitoring Without Performance Overhead -Oracle Whitepaper ๏Oracle Java SE Advanced ๏InfoQ-Mission Control and Flight Recorder on HotSpotJVM ๏JMC & JFR -Diagnostic Tools 18