Date post: | 08-Jul-2015 |
Category: |
Technology |
Upload: | marcus-hirt |
View: | 968 times |
Download: | 3 times |
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1
Production Time Profiling Out of the Box
Marcus Hirt
Consulting Member of Technical Staff
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3
Program Agenda
Introduction to Mission Control
Convergence Status
Brief Look at the JMX Console
Java Flight Recorder
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4
Program Agenda
Experimental Plug-ins
Future
Resources
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.5
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,
and timing of any features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6
Java Mission Control Overview
A tools suite for production use (fine in development too)
– Basic monitoring
– Production time profiling and diagnostics
Focus on low overhead
– Built into the JVM
– Already available runtime information
– High performance implementation
– More details during the Flight Recorder Tutorial
The new JDK profiling and diagnostics tools platform
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.7
History of Mission Control
The very first JVM management console
The JRockit Runtime Analyzer
– Mission Control 2
– Eclipse Based
The Latency Analyzer Tool (LAT)
JRockit Flight Recorder
JRockit Tooling
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
JVM Convergence
JRockit & HotSpot features to merge
Use HotSpot as base
Mission Control for HotSpot
Now released with 7u40!
Unfortunately named 5.2.0
It’s really a 1.0.0 release…
Oracle + Sun
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9
JVM Convergence
JRockit + Hotspot = Best of Breed JVM
– JCMD (JMX access) (8)
– Built-in Flight Recorder (engine only) (7u4)
– Flight Recorder Event Parity (7u40)
– On-line Heap Analysis
– Native Memory Tracking (JMX access)
– Soft Real-Time GC
– No Perm-Gen (8)
– Compiler Optimizations
– Improved JMX Agent & JDP (7u40)
– …
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10
JVM Convergence
JRockit + Hotspot = Best of Breed JVM
– JCMD (JMX access) (8)
– Built-in Flight Recorder (engine only) (7u4)
– Flight Recorder Event Parity (7u40)
– On-line Heap Analysis
– Native Memory Tracking
– Soft Real-Time GC
– No Perm-Gen (8)
– Compiler Optimizations
– Improved JMX Agent & JDP (7u40)
– …
Used by Mission Control
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11
Java Mission Control Toolset
JMX Console
– For monitoring running Java processes in real time
– Monitoring of a few select key indicators
– The implementation in JMC is quite good!
Java Flight Recorder
– Analogous to a data flight recorder (DFR) in a modern aircraft
– Profiling of running production systems!
(As delivered in the JDK 7u40 release)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12
Supported Platforms
Client
– Windows, Linux [x86,x64], MacOSX [x64]
– Building for Solaris x86 and Sparc – not distributed, nor supported
Server
– Windows, Linux [x86,x64], MacOSX [x64], Solaris [x86,x64,SPARC]
– For OS version specifics, see the 7u40 supported platforms.
Supported Platforms
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13
JMC INSTALLATION AND USAGE
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14
JMC installation
JMC stand alone client
– Simply download and install the JDK (>=7u40)
Eclipse version
– Install from update site on OTN:https://download.oracle.com/technology/products/missioncontrol/updatesites/base/5.2.0/eclipse/
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15
JMC installation, experimental plug-ins
Two classes of experimental plug-ins
– Features we think may be useful, but want feedback on
– Features not necessarily useful for J2SE users
Already configured in the stand alone client
– Choose Help | Install New Software…
Eclipse version
– Install from update site on OTN:https://download.oracle.com/technology/products/missioncontrol/updatesites/experimental/5.2.0/eclipse/
Note that experimental plug-ins are:
– Not as thoroughly tested as JMC base
– Not supported
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16
Starting the JMC client
Just double-click on the launcher in bin
Starting from the command line is useful for trouble shooting:jmc –consoleLog –debug 2>&1 | more
More info on http://hirt.se/blog/?p=281
The logging settings file (in java.util.logging format) can be specified
from the preferences
– Window | Preferences | Java Mission Control | Logging Settings File
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17
Starting the server
To be able to access Flight Recorder
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
Not dynamically enabled like in JRockit (yet)
There are plenty of command line options for controlling JFR
– More on this in the Tutorial
– Some examples can be found on http://hirt.se/blog
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18
Starting the Management Agent
Use the com.sun.management.jmxremote properties as normalhttp://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html
Don’t forget – rmi registry and server port can be set to the same
port – good for tunneling! (>=7u4)com.sun.management.jmxremote.rmi.port
To broadcast the presence of the agent on the network (7u40):com.sun.management.jmxremote.autodiscovery=true
com.sun.management.jdp.name=mygroup/MyJVM (optional)
Sometimes RMI will get the hostname wrong:
java.rmi.server.hostname=<hostname client should use>
For remote access
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19
TOOLS WALK-THROUGH
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20
The JMX Console
Simple but feature rich JMX Console
– JConsole on steroids
Real time monitoring of key indicators
Triggers
– Simple rules engine
– User can provide custom actions
Various experimental plug-ins
– Coherence
– JConsole plug-in support
– …
Highlights
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21
JMX CONSOLEDEMO
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22
High performance JVM event recorder
Produces binary recordings
Recordings contain runtime profile information
The recorder can be running continuously
– Whenever something happens, the data can
be dumped
– A bit like having a ”black box” for the JVM
Recordings are self describing and self contained
More on the Flight Recorder in the tutorial tomorrow
Flight RecorderHighlights
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23
FLIGHT RECORDER DEMO
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24
Experimental Plugins
WLS plug-in –> tutorial tomorrow
DTrace plug-in
– Extended DScript language to produce self describing events
– Visualization similar to Flight Recorder
JOverflow
– Tool for analyzing heap waste (empty/sparse collections)
– Uses hprof dumps
– First stab at using Java FX for visualization in a JMC plug-in
Downloadable from within Mission Control
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25
DTRACE DEMO
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26
JOVERFLOWDEMO
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27
Java Mission Control Future
Currently working on 5.3.0
– Will be released with JDK 8 and a later 7 update
– Improved JMX Console (Remote Diagnostic Commands and more)
– Improved content type handling and formatting
– 5.3.0 almost feature complete
Also working on 6.0.0
– Automatic analysis of flight recordings
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28
Some Java Mission Control Resources
Homepage:
http://oracle.com/missioncontrol
Twitter:@javamissionctrl
@hirt
Blog:http://hirt.se/blog
Facebook (not kidding!):http://www.facebook.com/pages/Java-Mission-Control/275169442493206
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29
Shameless Book PlugOracle JRockit: The Definitive Guide
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30
Maurizio CimadamoreEx Lang Tools, Oracle
“It's an invaluable piece of work.”
“I managed to do in one day what I've failed to do in 2+ weeks using <profiling tool> and <another profiling tool>.”
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31
Graphic Section Divider
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32