Using Java Flight Recorder Triggers [Video]

DZone 's Guide to

Using Java Flight Recorder Triggers [Video]

This 15-minute video walks through how to use Java Flight Recorder, particularly the use of triggers that you can create to enforce rules for Flight Recorder dumps.

· Java Zone ·
Free Resource

A good amount has been written and said about Java Flight Recorder, its integration into the Oracle Java SE Java Virtual Machine (JVM) and the very low overhead associated with enabling the framework. It not only makes the notion of collecting detailed runtime information about a Java application in production a possibility — it makes it a reality.

Many opt to place a program in Java Flight Recorder's Continuous Recording Mode. In this state, the Java application will collect runtime data indefinitely, where you can specify (or default to) how much data you want to retain before overwriting. Once in this mode, you can at any time, with many different options, dump the runtime information into a self-contained Flight Recorder file. From there, the Java Mission Control tool can be used to open this file to further diagnose your application's behavior.

Rather than randomly or periodically taking Flight Recorder dumps, it is also possible to conditionally do so. That is to say, you can, through the use of triggers, create rules that will cause a Flight Recorder dump to take place when a defined condition is met.  It's hopefully not difficult to envision that in this scenario triggers could help you focus on detailed runtime information when things start to go bad, as opposed to looking at a much larger data set. 

The video that follows goes through a simple session, demonstrating how to trigger a Flight Recording dump (7 minutes into the video) and briefly uses Mission Control to diagnose the sample application's behavior based on reading the dumped flight recording.

java ,java flight recorder ,java mission control ,triggers ,tutorial

Published at DZone with permission of Jim Connors . See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}