Java Flight Recorder is a tool for collecting diagnostic and profiling data about a running Java application. This tool is built into the JVM and can be enabled with minimal performance overhead.
Source Code
java -XX:StartFlightRecording=duration=60s,filename=myrecording.jfr MyApplication
Use JFR for deep performance diagnostics, including CPU, heap, and threads, to troubleshoot and optimize your Java applications.