1. Home
  2. Troubleshooting
  3. How to collect performance data using Java Flight Recorder

How to collect performance data using Java Flight Recorder


If you are experiencing performance issues with Diplomat MFT, and wish to diagnose what is causing the problem, you can use Java Flight Recording to capture performance data of the appliation. This procedure will generate a “flight recording” file that contains information on the application calls, memory, and CPU utilization. You can then deliver this to the Coviant Software support team for analysis.

Step 1: Prepare your environment

Open an administrative Command Prompt and type the following commands (if you installed Diplomat MFT to any other location, replace with the paths appropriate to your environment):

C:\> set JAVA_HOME=C:\Program Files\Coviant Software\diplomat-j\jre 
C:\> set PATH="C:\Program Files\Coviant Software\diplomat-j\jre\bin";%PATH% 
C:\>  tasklist | findstr /i tomcat 

From the “tasklist” command, you will see output of the tomcat8.exe process that is hosting our Diplomat MFT solution. Take note of the number value in the second column; this is the Process Identifier (“PID”) that we need to use for recording information.
For example, on my machine the output of the “tasklist” command is:

tomcat8.exe                  14348 Services                   0    121,968 K 

so my PID is 14348.

Step 2: Start the flight recording

Now we can start the flight recording by typing the following command. Use the PID value that you obtained from the previous step (I use my example of “14348”):

C:\> jcmd 14348 JFR.start 

You should get output similar to the following:

Started recording 1. No limit (duration/maxsize/maxage) in use. 

Step 3: Let the recording collect data

Leave this command prompt window open, and let the server run for a few hours (or until you reach the “out of resources” error, whichever comes first). We recommend that you let it run for at least an hour, so that we catch jobs that are scheduled every hour. Letting it run for more time will provide more data, which is good for analysis — but also makes for a larger recording file. There is no one “best” amount of time to let it run, but we recommend you choose a recording time around peak periods of utilization, and recording between 1-2 hours.

Step 4: Obtain the recording file

After allowing the application execute for a while, you can obtain the recording information as a file. From the administrative command prompt, type:

C:\> jcmd 14348 JFR.dump filename=c:\diplomat.jfr 

Or whatever path you wish to use to save the flight recording file.

C\:> jcmd 14348 JFR.dump filename=c:\diplomat.jfr

Step 5: Stop the recording

After you have written the Java Flight Recording data file in step #4, let’s stop the recording process. To do so, you will issue a JFR.stop command as follows. (Under some conditions, you will get an error stating “the option ‘name’ is mandatory” if we do not include it, which is why we add the word “name” to the end of the command):

C:\> jcmd 14348 JFR.stop name

Step 6: Deliver the file for analysis

Now you can deliver the file to Coviant Software Technical Support for analysis (support@coviantsoftware.com). The file might be quite large, so ZIP it first (feel free to use a tool like 7-zip, which has a very good “7z” archive format which, set at “ultra” compression level, does a very good job of compressing). If the file is still too large for email delivery, contact our Technical Support team and we will set up an SFTP account which you can use to upload the file.

Updated on November 12, 2020

Was this article helpful?

Related Articles