Skip to content

Commit b77e1ab

Browse files
author
Jason Freeberg
authored
Instructions for Java Flight Recorder on Windows
Adds usage instructions for timed and continuous profiler recordings for Java Flight Recorder on Windows. This is already doc'd for Linux.
1 parent 7f653dd commit b77e1ab

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

articles/app-service/configure-language-java.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,32 @@ Do not deploy your .war using FTP. The FTP tool is designed to upload startup sc
3333

3434
Performance reports, traffic visualizations, and health checkups are available for each app through the Azure portal. For more information, see [Azure App Service diagnostics overview](overview-diagnostics.md).
3535

36+
### Use Flight Recorder
37+
38+
All Java runtimes on App Service that use the Azul JVMs have the Zulu Flight Recorder installed. You can use this to connect to the JVM and start a profiler recording or generate a heap dump. You can use the Flight Recorder to take a single timed recording, or to start a continuous recording with a fixed buffer size.
39+
40+
#### Start a timed recording
41+
42+
To take a timed recording first navigate to Kudu > Process Explorer and get the PID (Process ID) for "java" in the table.
43+
44+
Then open the Debug Console and run the following command, replacing `<pid>` with the process ID you found in the previous step. This command will start a 30 second profiler recording of your Java application and generate a file named `timed_recording_example.jfr` with
45+
46+
```
47+
jcmd <pid> JFR.start name=TimedRecording settings=profile duration=30s filename="D:/home/timed_recording_example.JFR"
48+
```
49+
50+
For more information, please see the [Jcmd Command Reference](https://docs.oracle.com/javacomponents/jmc-5-5/jfr-runtime-guide/comline.htm#JFRRT190).
51+
52+
#### Start a continuous recording
53+
54+
You can use Zulu Flight Recorder to continuously profile your Java application with minimal impact on runtime performance ([source](https://assets.azul.com/files/Zulu-Mission-Control-data-sheet-31-Mar-19.pdf)). To do so, run the following Azure CLI command to create an App Setting named `JAVA_OPTS` with the necessary configuration. The contents of the `JAVA_OPTS` App Setting are passed to the `java` command when your app is started.
55+
56+
For more information, please see the [Jcmd Command Reference](https://docs.oracle.com/javacomponents/jmc-5-5/jfr-runtime-guide/comline.htm#JFRRT190).
57+
58+
#### Analyze `.jfr` files
59+
60+
Use [FTPS](../deploy-ftp.md) to download your JFR file to your local machine. To analyze the JFR file, download and install [Zulu Mission Control](https://www.azul.com/products/zulu-mission-control/). For instructions on Zulu Mission Control, see the [Azul documentation](https://docs.azul.com/zmc/) and the [installation instructions](https://docs.microsoft.com/java/azure/jdk/java-jdk-flight-recorder-and-mission-control).
61+
3662
### Stream diagnostic logs
3763

3864
[!INCLUDE [Access diagnostic logs](../../includes/app-service-web-logs-access-no-h.md)]

0 commit comments

Comments
 (0)