javacro'14 - profile any environment with java flight recorder – johan janssen
Upload: hujak-hrvatska-udruga-java-korisnika-croatian-java-user-association
Post on 28-Nov-2014
944 views
DESCRIPTION
Since the Java 7 update 40 Java Flight Recorder and Mission Control are shipped with the JDK. With these tools it is possible to profile an application not only on a developer computer, but also on production. The overhead of profiling with Flight Recorder is minimal, which allows us to use the profiler on any environment. These profiling tools are relatively new and unfortunately unknown to a lot of developers. This talk will give an overview of Java Flight Recorder and Mission Control so the audience can start profiling their applications afterwards.TRANSCRIPT
![Page 1: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/1.jpg)
Johan Janssen, Info Support
![Page 2: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/2.jpg)
![Page 3: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/3.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/4.jpg)
![Page 5: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/5.jpg)
![Page 6: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/6.jpg)
![Page 7: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/7.jpg)
![Page 8: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/8.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/9.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/10.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/11.jpg)
![Page 12: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/12.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/13.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/14.jpg)
![Page 15: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/15.jpg)
� 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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/16.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/17.jpg)
![Page 18: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/18.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/19.jpg)
![Page 20: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/20.jpg)
�JConsole++
�Live, real time monitoring of JVM
�Triggers�Triggers
![Page 21: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/21.jpg)
![Page 22: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/22.jpg)
![Page 23: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/23.jpg)
![Page 24: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/24.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/25.jpg)
�Eclipse
�Application $JDK$\bin\jmc
�Commandline�Commandline
�Jcmd
![Page 26: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/26.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/27.jpg)
![Page 28: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/28.jpg)
![Page 29: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/29.jpg)
![Page 30: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/30.jpg)
![Page 31: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/31.jpg)
![Page 32: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/32.jpg)
![Page 33: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/33.jpg)
![Page 34: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/34.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/35.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/36.jpg)
� 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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/37.jpg)
![Page 38: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/38.jpg)
![Page 39: JavaCro'14 - Profile any environment with Java Flight Recorder – Johan Janssen](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/39.jpg)
�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](https://reader034.vdocuments.us/reader034/viewer/2022042601/5478ea3b5906b567048b45ff/html5/thumbnails/40.jpg)