- System requirements
- Profiler architecture
- Running the profiler
- Profiler activation
- Start profiling
- IDE integration
- Java server integration wizard
- Attach profiler to a running application
- Remote profiling
- Docker
- Enabling profiling manually
- Startup options
- Connect to profiled application
- Profiling troubleshooting
- Profiling overhead: how to reduce or avoid
- Solving performance problems
- CPU profiling
- Threads
- Deadlock detector
- Memory profiling
- Garbage collection
- Monitor profiling
- Exception profiling
- Probes: monitor events of various kinds
- Performance Charts
- Inspections: automatic recognition of typical problems
- Automatically trigger actions on event
- Summary, snapshot annotation, automatic deobfuscation
- Time measurement (CPU time, wall time)
- Filters
- Snapshot directory customization
- Export of profiling results to HTML, CSV, XML, plain text
- Profiler Java API
- Profiler HTTP API
- Command line tool to control profiling
- Settings
- FAQ: How to profile in my scenario?
Enabling profiling manually
Add VM option '-agentpath'
Add -agentpath:<full agent library path>
VM option
to the command line of Java application to be profiled.
The agent library path depends on your OS:
Platform | VM option | |
AIX | ppc64, 64-bit Java | -agentpath:<profiler directory>/bin/aix-ppc-64/libyjpagent.so |
FreeBSD | x86, 64-bit Java | -agentpath:<profiler directory>/bin/freebsd-x86-64/libyjpagent.so |
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 |
|
ppc64, 64-bit Java, big-endian | -agentpath:<profiler directory>/bin/linux-ppc-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 have copied the profiler agent library file from the profiler installation directory to another location, please change the path accordingly.
You can find examples of startup scripts for your platform in
<profiler directory>/samples
To check that Java can load the profiler agent, invoke the following command:
java -agentpath:<full agent library path> -version
If agent is loaded, you will see an output like this
[YourKit Java Profiler 2022.9-b160] Log file: C:\Users\johndoe\.yjp\log\java.exe-12345.log
Specifying agent options
You can specify additional startup options. In most cases there's no need to use them.
To profile a Java server (especially JBoss!),
specify startup option delay=10000
The options are comma separated: -agentpath:<full agent library path>[=<option>, ...]
.
Examples
java -agentpath:c:\yourkit\yjpagent.dll FooClass
java -agentpath:c:\yourkit\yjpagent.dll=alloceach=10,allocsizelimit=4096 FooClass
java -agentpath:c:\yourkit\[email protected] FooClass