Transcript
Page 1: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

Johan Janssen, Info Support

Page 2: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 3: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Current situation

�Why should we use a profiler?

�Java Mission Control�Java Mission Control

�Java Flight Recorder

�JOverflow plugin

�Demo

�Questions

Page 4: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 5: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 6: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 7: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 8: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�High application response time

�High memory usage (per end user)

�High CPU usage�High CPU usage

�High I/O

�We want to create high quality software!

Page 9: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Increase Java memory settings

�Increase physical memory

�Increase CPU’s�Increase CPU’s

�Distribute application over multiple

machines

Page 10: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Scaling is difficult

oMemory per machine is limited

oMemory bandwidth is limited

Garbage collection�Garbage collection

�Maintenance cost

�We still have low quality software!

Page 11: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 12: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�High performance

oMinimal overhead (1-3%)

oUsable in productionoUsable in production

�New in Java 7 u40

�Integrated in the Hotspot JVM from the

JRockit JVM

�Commercial feature for production

�Free for development use

Page 13: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Method profiling

�Allocation profiling

�I/O analysis�I/O analysis

�Garbage collector analysis

�Third party events analysis

�Exceptions analysis

�Heap analysis

�Configure triggers

Page 14: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 15: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

� JMX compliant monitoring tool

� Dynamically monitor and manage the JVM

� Analyze recordings made by the Flight Recorder

� Fully customizable dashboards� Fully customizable dashboards

� Java 7 u40 contains 5.2.0

� Java 8 contains 5.3.0

o Minor release

o Bugfixes and incremental improvements (UI

etcetera)

o Eclipse support

Page 16: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Eclipse

o Integration with codebase

�Application $JDK$\bin\jmcApplication $JDK$\bin\jmc

Page 17: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 18: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Adjust eclipse.ini-showsplash

org.eclipse.platform

-vm-vm

C:\Program Files\Java\jdk1.8.0_05\jre\bin

�Install new softwarehttp://download.oracle.com/technology/products/missionconhttp://download.oracle.com/technology/products/missionconhttp://download.oracle.com/technology/products/missionconhttp://download.oracle.com/technology/products/missioncontrol/updatesites/base/5.3.0/eclipse/trol/updatesites/base/5.3.0/eclipse/trol/updatesites/base/5.3.0/eclipse/trol/updatesites/base/5.3.0/eclipse/

�Install Mission Control

Page 19: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 20: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�JConsole++

�Live, real time monitoring of JVM

�Triggers�Triggers

Page 21: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 22: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 23: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 24: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Record and analysis tool for JVM’s

�JVM events are recorded in detail

�Minimal performance impact�Minimal performance impact

�Recording files

o JFR binary

�Multiple recordings at the same time

Page 25: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Eclipse

�Application $JDK$\bin\jmc

�Commandline�Commandline

�Jcmd

Page 26: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Use correct JDK

�Specify correct options:�Specify correct options:

-XX:+UnlockCommercialFeatures

-XX:+FlightRecorder

Page 27: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 28: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 29: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 30: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 31: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 32: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 33: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 34: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Perform heap dump

�Visualize heap dump

�Analyze heap dump (automatically) �Analyze heap dump (automatically)

Page 35: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Unused data structures

�Data structures that reserve more

space as the default size is bigger

�Objects instead of primitives

�Complex collections instead of arrays

�Duplicate data

Page 36: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

� Apply manual patch before installing plugins!!Apply manual patch before installing plugins!!Apply manual patch before installing plugins!!Apply manual patch before installing plugins!!

� Remove the following lines from

<JDK>/lib/missioncontrol/configuration/org.eclips

e.equinox.simpleconfigurator/bundles.info :e.equinox.simpleconfigurator/bundles.info :

org.eclipse.equinox.log.nl_ja

org.eclipse.equinox.log.nl_zh

org.eclipse.equinox.supplement.nl_ja

org.eclipse.equinox.supplement.nl_zh

Page 37: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 38: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen
Page 39: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

�Overlap with Mission Control

�Tools are part of OpenJDK

�Likely to stay alongside Mission Control�Likely to stay alongside Mission Control

�Development will focus on Mission

Control

Page 40: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen

Recommended