Skip to content

Commit 4727ead

Browse files
Merge pull request #235605 from brunoborges/patch-2
Use App Insights Java Profiler (JFR built-in) instead of JFR
2 parents 151bc5a + 3072e91 commit 4727ead

File tree

1 file changed

+9
-59
lines changed

1 file changed

+9
-59
lines changed

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

Lines changed: 9 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -206,61 +206,11 @@ The built-in Java images are based on the [Alpine Linux](https://alpine-linux.re
206206
207207
::: zone-end
208208
209-
### Flight Recorder
209+
### Java Profiler
210210
211-
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.
211+
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.
212212
213-
::: zone pivot="platform-windows"
214-
215-
#### Timed Recording
216-
217-
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).
218-
219-
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.
220-
221-
```
222-
jcmd <pid> JFR.start name=TimedRecording settings=profile duration=30s filename="D:\home\timed_recording_example.JFR"
223-
```
224-
225-
::: zone-end
226-
::: zone pivot="platform-linux"
227-
228-
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).
229-
230-
```shell
231-
078990bbcd11:/home# jcmd
232-
Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
233-
147 sun.tools.jcmd.JCmd
234-
116 /home/site/wwwroot/app.jar
235-
```
236-
237-
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.)
238-
239-
```shell
240-
jcmd 116 JFR.start name=MyRecording settings=profile duration=30s filename="/home/jfr_example.jfr"
241-
```
242-
243-
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.
244-
245-
#### Continuous Recording
246-
247-
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.
248-
249-
```azurecli
250-
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
251-
```
252-
253-
Once the recording has started, you can dump the current recording data at any time using the `JFR.dump` command.
254-
255-
```shell
256-
jcmd <pid> JFR.dump name=continuous_recording filename="/home/recording1.jfr"
257-
```
258-
259-
::: zone-end
260-
261-
#### Analyze `.jfr` files
262-
263-
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).
213+
To learn more about the Java Profiler, visit the [Azure Application Insights documentation](/azure/azure-monitor/app/java-standalone-profiler).
264214
265215
### App logging
266216
@@ -304,7 +254,7 @@ To configure the app setting from the Maven plugin, add setting/value tags in th
304254
<appSettings>
305255
<property>
306256
<name>JAVA_OPTS</name>
307-
<value>-Xms512m -Xmx1204m</value>
257+
<value>-Xms1024m -Xmx1024m</value>
308258
</property>
309259
</appSettings>
310260
```
@@ -1161,13 +1111,13 @@ Microsoft and Adoptium builds of OpenJDK are provided and supported on App Servi
11611111
11621112
| Java Version | Linux | Windows |
11631113
|--------------|------------------|----------------------|
1164-
| Java 8 | 1.8.0_312 (Zulu) * | 1.8.0_312 (Adoptium) |
1165-
| Java 11 | 11.0.13 (MSFT) | 11.0.13 (MSFT) |
1166-
| Java 17 | 17.0.1 (MSFT) | 17.0.1 (MSFT) |
1114+
| Java 8 | 1.8.0_312 (Adoptium) * | 1.8.0_312 (Adoptium) |
1115+
| Java 11 | 11.0.13 (Microsoft) | 11.0.13 (Microsoft) |
1116+
| Java 17 | 17.0.1 (Microsoft) | 17.0.1 (Microsoft) |
11671117
11681118
\* In following releases, Java 8 on Linux will be distributed from Adoptium builds of the OpenJDK.
11691119
1170-
If you are [pinned](#choosing-a-java-runtime-version) to an older minor version of Java your site may be using the [Zulu for Azure](https://www.azul.com/downloads/#zulu) binaries provided through [Azul Systems](https://www.azul.com/). You can continue to use these binaries for your site, but any security patches or improvements will only be available in new versions of the OpenJDK, so we recommend that you periodically update your Web Apps to a later version of Java.
1120+
If you are [pinned](#choosing-a-java-runtime-version) to an older minor version of Java, your site may be using the deprecated [Azul Zulu for Azure](https://devblogs.microsoft.com/java/end-of-updates-support-and-availability-of-zulu-for-azure/) binaries provided through [Azul Systems](https://www.azul.com/). You can continue to use these binaries for your site, but any security patches or improvements will only be available in new versions of the OpenJDK, so we recommend that you periodically update your Web Apps to a later version of Java.
11711121
11721122
Major version updates will be provided through new runtime options in Azure App Service. Customers update to these newer versions of Java by configuring their App Service deployment and are responsible for testing and ensuring the major update meets their needs.
11731123
@@ -1190,7 +1140,7 @@ If a supported Java runtime will be retired, Azure developers using the affected
11901140
11911141
### Local development
11921142
1193-
Developers can download the Production Edition of Azul Zulu Enterprise JDK for local development from [Azul's download site](https://www.azul.com/downloads/#zulu).
1143+
Developers can download the Microsoft Build of OpenJDK for local development from [our download site](/java/openjdk/download).
11941144
11951145
### Development support
11961146

0 commit comments

Comments
 (0)