Skip to content

Commit f9417d1

Browse files
Merge branch 'master' into aliciatheurk/template-variables-upate
2 parents 9eea6bd + 24a6dd5 commit f9417d1

File tree

1 file changed

+40
-0
lines changed
  • content/en/tracing/trace_collection/compatibility

1 file changed

+40
-0
lines changed

content/en/tracing/trace_collection/compatibility/java.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,44 @@ Integrations can be enabled or disabled individually (overriding the default abo
294294
- Loading multiple Java Agents that perform APM/tracing functions is not a recommended or supported configuration.
295295
- When enabling the tracer for Java 24+, you may see warnings related to JNI native access or `sun.misc.Unsafe` memory access. Suppress these warnings by adding the `--illegal-native-access=allow` and `--sun-misc-unsafe-memory-access=allow` environment variables right before the `-javaagent:/path/to/dd-java-agent.jar` argument. See [JEP 472][13] and [JEP 498][14] for more information.
296296

297+
## Ahead-of-time (AOT) class loading & linking support
298+
299+
To improve startup time, Ahead-of-time (AOT) class loading & linking makes application classes instantly available in a loaded and linked state when the JVM starts. See [JEP 483][15] and [JEP 514][16] for more information.
300+
301+
### Requirements
302+
303+
Use:
304+
305+
- Java 25 or later
306+
- [Datadog Java tracer][1] 1.57.0 or later
307+
308+
### Setup
309+
310+
To set up AOT class loading & linking for APM, add the Datadog Java tracer during the training run:
311+
```shell
312+
java -javaagent:/path/to/dd-java-agent.jar -XX:AOTCacheOutput=app.aot -jar App.jar
313+
```
314+
315+
#### Usage
316+
317+
During production, add the same Datadog Java tracer along with the previously cached training data:
318+
```shell
319+
java -javaagent:/path/to/dd-java-agent.jar -XX:AOTCache=app.aot -jar App.jar
320+
```
321+
322+
You can view traces using the [Trace Explorer][9].
323+
324+
{{% collapse-content title="Troubleshooting" level="h4" %}}
325+
##### Not attaching the Datadog Java tracer during the training run
326+
327+
If you see this warning in production, it means the Datadog Java tracer wasn't attached during training:
328+
```
329+
Mismatched values for property jdk.module.addmods: java.instrument specified during runtime but not during dump time
330+
```
331+
The JVM cannot then use the AOT cache to improve startup time. The solution is to attach the tracer during training.
332+
333+
{{% /collapse-content %}}
334+
297335
## GraalVM Native Image support
298336

299337
GraalVM Native Image is a technology that allows you to compile Java applications into native executables. The Datadog Java tracer supports GraalVM Native Image. This allows you to compile your applications into native executables while still benefiting from the tracing capabilities offered by the library.
@@ -487,3 +525,5 @@ For more information, see [Configure APM and DogstatsD communication mode][11].
487525
[12]: /tracing/trace_collection/library_config/#agent
488526
[13]: https://openjdk.org/jeps/472
489527
[14]: https://openjdk.org/jeps/498
528+
[15]: https://openjdk.org/jeps/483
529+
[16]: https://openjdk.org/jeps/514

0 commit comments

Comments
 (0)