Skip to content

Commit bf73a3d

Browse files
authored
Refer to Java Profiler in App Insights
1 parent d20d5d6 commit bf73a3d

File tree

1 file changed

+4
-54
lines changed

1 file changed

+4
-54
lines changed

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

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -208,61 +208,11 @@ The built-in Java images are based on the [Alpine Linux](https://alpine-linux.re
208208
209209
::: zone-end
210210
211-
### Flight Recorder
211+
### Java Profiler
212212
213-
All Java runtimes on App Service using the Azul JVMs come with the Zulu Flight Recorder. You can use this to record JVM, system, and application events and troubleshoot problems in your Java applications.
213+
All Java runtimes on Azure App Service come with the JDK Flight Recorder for profiling Java workloads. You can use this to record JVM, system, and application events and troubleshoot problems in your applications.
214214
215-
::: zone pivot="platform-windows"
216-
217-
#### Timed Recording
218-
219-
To take a timed recording, you'll need the PID (Process ID) of the Java application. To find the PID, open a browser to your web app's SCM site at `https://<your-site-name>.scm.azurewebsites.net/ProcessExplorer/`. This page shows the running processes in your web app. Find the process named "java" in the table and copy the corresponding PID (Process ID).
220-
221-
Next, open the **Debug Console** in the top toolbar of the SCM site and run the following command. Replace `<pid>` with the process ID you copied earlier. This command will start a 30-second profiler recording of your Java application and generate a file named `timed_recording_example.jfr` in the `D:\home` directory.
222-
223-
```
224-
jcmd <pid> JFR.start name=TimedRecording settings=profile duration=30s filename="D:\home\timed_recording_example.JFR"
225-
```
226-
227-
::: zone-end
228-
::: zone pivot="platform-linux"
229-
230-
SSH into your App Service and run the `jcmd` command to see a list of all the Java processes running. In addition to jcmd itself, you should see your Java application running with a process ID number (pid).
231-
232-
```shell
233-
078990bbcd11:/home# jcmd
234-
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
235-
147 sun.tools.jcmd.JCmd
236-
116 /home/site/wwwroot/app.jar
237-
```
238-
239-
Execute the command below to start a 30-second recording of the JVM. This will profile the JVM and create a JFR file named *jfr_example.jfr* in the home directory. (Replace 116 with the pid of your Java app.)
240-
241-
```shell
242-
jcmd 116 JFR.start name=MyRecording settings=profile duration=30s filename="/home/jfr_example.jfr"
243-
```
244-
245-
During the 30-second interval, you can validate the recording is taking place by running `jcmd 116 JFR.check`. This will show all recordings for the given Java process.
246-
247-
#### Continuous Recording
248-
249-
You can use Zulu Flight Recorder to continuously profile your Java application with minimal impact on runtime performance. 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.
250-
251-
```azurecli
252-
az webapp config appsettings set -g <your_resource_group> -n <your_app_name> --settings JAVA_OPTS=-XX:StartFlightRecording=disk=true,name=continuous_recording,dumponexit=true,maxsize=1024m,maxage=1d
253-
```
254-
255-
Once the recording has started, you can dump the current recording data at any time using the `JFR.dump` command.
256-
257-
```shell
258-
jcmd <pid> JFR.dump name=continuous_recording filename="/home/recording1.jfr"
259-
```
260-
261-
::: zone-end
262-
263-
#### Analyze `.jfr` files
264-
265-
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](/java/azure/jdk/java-jdk-flight-recorder-and-mission-control).
215+
To learn more about the Java Profiler, visit the [Azure Application Insights documentation](/azure/azure-monitor/app/java-standalone-profiler).
266216
267217
### App logging
268218
@@ -306,7 +256,7 @@ To configure the app setting from the Maven plugin, add setting/value tags in th
306256
<appSettings>
307257
<property>
308258
<name>JAVA_OPTS</name>
309-
<value>-Xms512m -Xmx1204m</value>
259+
<value>-Xms1024m -Xmx1024m</value>
310260
</property>
311261
</appSettings>
312262
```

0 commit comments

Comments
 (0)