Skip to Main Content

Java HotSpot Virtual Machine

Can flight recording be triggered programatically?

Andy DufresneFeb 19 2015 — edited Sep 7 2015

Java mission control's flight recording feature looks great and seems to be perfect for troubleshooting production issues for e.g. high cpu. I had a question - Can the flight recording be triggered programmatically from with the java application? I understand that flight recording could be triggered through jvm options like -XX:StartFlightRecording=duration=60s,filename=myrecording.jfr but this is not what I am referring too. I am also aware of the fact that using flight recording in production environments requires a Java SE Advanced License.

I see two advantages in doing programmatic triggering of the flight recording

1. Avoids manual intervention in connecting to all production environments (which seems practically impossible when there are more than hundreds of jvms running)?

2. Less reliability on the support & operations team to know how to do flight recording?

I visualize it to be triggered by a thread which monitors jmx metrics periodically (for e.g. ProcessJVMLoad) and triggers a flight recording if the value goes above 90% (for 3 times consecutively). The flight recording could be a specific duration and the location could be picked from configuration.

This post has been answered by Hirt-Oracle on Feb 19 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 5 2015
Added on Feb 19 2015
8 comments
3,222 views