From b3b170fbabce8ee1658d450cc83ef3e0da8ec879 Mon Sep 17 00:00:00 2001 From: Marc Sanmiquel Date: Tue, 1 Oct 2024 22:57:45 +0200 Subject: [PATCH] docs: update pyroscope.java JVM configuration (#1779) Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> (cherry picked from commit 62b6fb5f3aeba1cd48e09e9a5d9c01b4b944c801) --- .../reference/components/pyroscope/pyroscope.java.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/sources/reference/components/pyroscope/pyroscope.java.md b/docs/sources/reference/components/pyroscope/pyroscope.java.md index 85a3233abe..a74464d22a 100644 --- a/docs/sources/reference/components/pyroscope/pyroscope.java.md +++ b/docs/sources/reference/components/pyroscope/pyroscope.java.md @@ -27,6 +27,16 @@ pyroscope.java "LABEL" { } ``` +## Target JVM configuration + +When you use `pyroscope.java` to profile Java applications, you can configure the target JVMs with some command line flags that ensure accurate profiling, especially for inlined methods. Add the following flags to your Java application's startup command: + +```java +-XX:+UnlockDiagnosticVMOptions -XX:+DebugNonSafepoints +``` + +For more details, refer to [Restrictions/Limitations](https://github.com/async-profiler/async-profiler?tab=readme-ov-file#restrictionslimitations) in the async-profiler documentation. + ## Arguments The following arguments are supported: