production time profiling out of the box

32
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 1

Upload: marcus-hirt

Post on 08-Jul-2015

968 views

Category:

Technology


3 download

DESCRIPTION

Slides from my JavaOne presentation

TRANSCRIPT

Page 1: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1

Page 2: Production Time Profiling Out of the Box

Production Time Profiling Out of the Box

Marcus Hirt

Consulting Member of Technical Staff

Page 3: Production Time Profiling Out of the Box

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

Page 4: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.4

Program Agenda

Experimental Plug-ins

Future

Resources

Page 5: Production Time Profiling Out of the Box

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.

Page 6: Production Time Profiling Out of the Box

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

Page 7: Production Time Profiling Out of the Box

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

Page 8: Production Time Profiling Out of the Box

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

Page 9: Production Time Profiling Out of the Box

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)

– …

Page 10: Production Time Profiling Out of the Box

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

Page 11: Production Time Profiling Out of the Box

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)

Page 12: Production Time Profiling Out of the Box

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

Page 13: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13

JMC INSTALLATION AND USAGE

Page 14: Production Time Profiling Out of the Box

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/

Page 15: Production Time Profiling Out of the Box

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

Page 16: Production Time Profiling Out of the Box

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

Page 17: Production Time Profiling Out of the Box

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

Page 18: Production Time Profiling Out of the Box

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

Page 19: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19

TOOLS WALK-THROUGH

Page 20: Production Time Profiling Out of the Box

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

Page 21: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21

JMX CONSOLEDEMO

Page 22: Production Time Profiling Out of the Box

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

Page 23: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23

FLIGHT RECORDER DEMO

Page 24: Production Time Profiling Out of the Box

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

Page 25: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25

DTRACE DEMO

Page 26: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26

JOVERFLOWDEMO

Page 27: Production Time Profiling Out of the Box

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

Page 28: Production Time Profiling Out of the Box

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

Page 29: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29

Shameless Book PlugOracle JRockit: The Definitive Guide

Page 30: Production Time Profiling Out of the Box

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>.”

Page 31: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31

Graphic Section Divider

Page 32: Production Time Profiling Out of the Box

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32