- System requirements
- Profiler architecture
- Profiler installation
- Uninstall profiler
- Running the profiler
- Profiler activation
- Welcome screen
- Start profiling
- Profiling overhead
- Snapshots
- Solving performance problems
- CPU profiling
- Thread profiling
- Virtual threads support
- Object allocation profiling
- Memory profiling
- Monitor profiling
- Exception profiling
- Telemetry
- Probes: monitor events of various kinds
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Automatic deobfuscation
- Summary
- Filters
- Profiler command line
- Export of profiling results to external formats
- Profiler Java API
- Profiler HTTP API
- Settings
- Troubleshooting and FAQ
Enabling profiling manually
Add '-agentpath' JVM option
Add -agentpath:<full agent library path>
JVM option
to the command line of Java application to be profiled.
The library depends on your operating system and its bitness.
For Linux, it is also important to choose either the glibc
or musl
version of the agent.
Platform | JVM option | |
Linux (glibc) | x86, 32-bit Java | -agentpath:<profiler directory>/bin/linux-x86-32/libyjpagent.so |
x86, 64-bit Java | -agentpath:<profiler directory>/bin/linux-x86-64/libyjpagent.so |
|
ARM 32-bit (ARMv7 and higher, hard-float) | -agentpath:<profiler directory>/bin/linux-arm-32/libyjpagent.so |
|
ARM 64-bit (AArch64) | -agentpath:<profiler directory>/bin/linux-arm-64/libyjpagent.so |
|
ppc64le, 64-bit Java, little-endian | -agentpath:<profiler directory>/bin/linux-ppc-64le/libyjpagent.so |
|
Linux (Alpine, musl) | x86, 64-bit Java | -agentpath:<profiler directory>/bin/linux-musl-x86-64/libyjpagent.so |
ARM 64-bit (AArch64) | -agentpath:<profiler directory>/bin/linux-musl-arm-64/libyjpagent.so |
|
macOS | Universal binary for arm64 and x86_64 |
-agentpath:<profiler directory>/Contents/Resources/bin/mac/libyjpagent.dylib |
Windows | x86, 32-bit Java | -agentpath:<profiler directory>\bin\windows-x86-32\yjpagent.dll |
x86, 64-bit Java | -agentpath:<profiler directory>\bin\windows-x86-64\yjpagent.dll |
|
ARM 64-bit (AArch64) | -agentpath:<profiler directory>\bin\windows-arm-64\yjpagent.dll |
If you copied the profiler agent library from the installation directory to another location, update the path accordingly.
To verify that Java can load the profiler agent, run the following command:
java -agentpath:<full agent library path> -version
If the agent loads, you'll see an output like
openjdk version "11.0.24" 2024-07-16
.
If there's an error, check the error message and refer to the
troubleshooting guide.
Common issues include specifying the wrong path,
using a 64-bit agent on a 32-bit system,
or using a glibc agent on a musl system.
Specifying agent options
You can specify additional agent startup options to change defaults and control profiler features. The options are a comma-separated list. Specify multiple options by separating them with commas:
-agentpath:<full agent library path>[=<option1>,<option2> ...]
.
Examples
java -agentpath:c:\yourkit\yjpagent.dll FooClass
java -agentpath:c:\yourkit\yjpagent.dll=alloc_each=10,alloc_size_limit=4096 FooClass
java -agentpath:c:\yourkit\yjpagent.dll=@options.txt FooClass