How do I configure YourKit Java profiler to work with CQ3.x or CQ4.x?
YourKit Java Profiler is able to restores original class, method and field names of applications obfuscated with ProGuard, yGuard, Zelix KlassMaster, Allatori, and other popular Java obfuscators. If you are developing a Minecraft mod, just give the profiler your MCP mapping file, and it will show the original names. You control the overhead. Yourkit Java Profiler: WALL TIME is probably measured incorrectly for Object.wait Ask Question Asked 3 years, 9 months ago. Active 3 years, 8 months ago. Viewed 413 times -1. The initial problem I'm trying to solve is to see the wall times of all subcalls of a method across many threads. But I replicated my problem with a tiny application. Performance bottlenecks are often in places one would never expect and arise when code is used in a different scale than during development. To really identi.
Download the YourKit agent for your OS (see the links at the bottom of the page).
Start the YourKit profiler (JDK 1.5 is necessary to run the profiler).
- Windows: Launch 'YourKit Java Profiler' from in the Start menu.
- Linux, Solaris: Run YourKit Java Profiler Home > /bin/yjp.sh.
- Mac OS X: When the downloaded application is unzipped, click its icon.
It's possible to enable profiling directly in an IDE or even J2EE server. However, it can be better to enable profiling manually to be independent of IDE or J2EE servers. The procedure differs from OS to OS.
OS | Action |
---|---|
Windows, 32-bit Java | add <!YourKit Java Profiler Home>binwin32 to the PATH |
Windows, 64-bit Java | add <!YourKit Java Profiler Home>binwin-amd64 to the PATH |
Mac OS X | add <!YourKit Java Profiler Home>/bin/mac to the DYLD_LIBRARY_PATH |
Linux x86, 32-bit Java | add <!YourKit Java Profiler Home>/bin/linux-x86-32 to the LD_LIBRARY_PATH |
Linux AMD64, 64-bit Java | add <!YourKit Java Profiler Home>/bin/linux-amd64 to the LD_LIBRARY_PATH |
Solaris SPARC, 32-bit Java | add <!YourKit Java Profiler Home>/bin/solaris-sparc-32 to the LD_LIBRARY_PATH |
Solaris SPARC, 64-bit Java | add <!YourKit Java Profiler Home>/bin/solaris-sparc-64 to the LD_LIBRARY_PATH |
Solaris x86, 32-bit Java | add <!YourKit Java Profiler Home>/bin/solaris-x86-32 to the LD_LIBRARY_PATH |
Solaris x86, 64-bit Java (AMD64) | add <!YourKit Java Profiler Home>/bin/solaris-x86-64 to the LD_LIBRARY_PATH |
To check that Java can load the profiler agent, you can call the following command that prints a description of agent parameters:
- Java 5 or 6
- java -agentlib:yjpagent=help
- Java 1.3 or 1.4
- java -Xrunyjpagent:help
To be able to profile a Java application, it is necessary to provide the YourKit tool an interface to the Java application. You integrate the YourKit agent library into the JVM where the target application you want to profile is running. First, enable profiling by providing the path to the respective OS agent library where the JVM is running on (see Enabling Profiling). Include setting environment variables in the start-script of your application.
For example, in a CQ start script under Linux, do the following:
#--------------------------------------------------------------------- # enables the YourKit Java Profiler #--------------------------------------------------------------------- YJP_HOME='/home/honwai/yjp-6.0.16/bin/linux-x86-32' export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$YJP_HOME
This setting makes the agent library available to the JVM. Now it is a matter of telling the JVM to actually integrate this library, which differs according to the JVM version in use:
Java Version | JVM Option |
---|---|
1.3/1.4 | java -Xrunyjpagent |
5 or newer | java -agentlib:yjpagent |
Now you're ready to start your application and the actual profiling. The agent library prints some information to the standard output (in case of CQ it is server(logs/startup.log):
[YourKit Java Profiler 6.0.16] Using JVMPI (Linux; 32 bit JVM)
[YourKit Java Profiler 6.0.16] *** HINT ***: Use Java 5 (or newer) when possible!
[YourKit Java Profiler 6.0.16] Profiler agent is listening on port 10001...
Hint: In CQ 4.2, the serverctl script has become more advanced, allowing for providing various options on startup. It includes the option to start the JVM with the YourKit agent library. Setting the above described env variables is still mandatory, but setting the additional JVM option is not:
Yourkit Java Profiler 2020.9
linuxbox:/opt/day/cq-4.2/server# ./start --profile
To get a complete list of the available options, type ./serverctl and you get a list of all available options.
When starting an application with profiling enabled, the agent library chooses a free port that is available on the system. It is not necessary to know the port. The YourKit tool can automatically connect to a running profiled application, either locally or remotely. If it finds more than one application, you are prompted to select a particular one.
It is also possible to specify a dedicated port if local security settings (for example, firewall) don't allow for arbitrary ports to be chosen. See the following table for a complete list of options that can be passed to the agent library.
Option | Description |
---|---|
disablealloc | (Java 5 and newer / JVMTI only) Don't instrument bytecode with instructions needed for object allocation recording. |
disablecounts | (Java 5 and newer / JVMTI only) Don't instrument bytecode with instructions needed for CPU tracing. Only CPU sampling is available. |
disablej2ee | (Java 5 and newer / JVMTI only) Don't instrument bytecode with instructions needed for J2EE profiling. |
sampling | Launch Java application with CPU sampling turned on. You do not have to profile CPU right from the start. Instead, in many cases you'd better start or stop the measuring later from the user interface or using Profiler API. |
tracing | Launch Java application with CPU tracing turned on. You do not have to profile CPU right from the start. Instead, in many cases, you'd better start or stop the measuring later from the user interface or using Profiler API. This option cannot be used in combination with 'disablecounts'. |
noj2ee | Don't perform J2EE high-level profiling. This option only affects CPU profiling started with 'sampling' or 'tracing'. |
alloc | Launch Java application with started object allocation recording. All objects are recorded. You do not have to record allocations right from the start; instead, you can start or stop recording later from the Profiler or using Profiler API. This option cannot be used in combination with 'disablealloc'. |
allocadaptive | Launch Java application with started object allocation recording. As many objects as possible are recorded, keeping overhead at moderate level. You do not have to record allocations right from the start; instead, you can start or stop recording later from the Profiler or using Profiler API. This option cannot be used in combination with 'disablealloc'. |
usedmem=<percent> | Automatically capture memory snapshot when used heap memory reaches the threshold. |
onexit=memory | Always capture memory snapshot on exit. CPU snapshot iscaptured automatically if CPU profiling is enabled when the profiled application exits. |
onexit=telemetry | Capture telemetry snapshot on exit. This option is automatically used when the profiled application is started from the IDE. |
port=<value> | Specify port that the profiler agent listens on for communication with the Profiler. By default any free port is chosen. |
onlylocal | Allow only local connections to profiled application |
dir=<directory for='for' snapshots='snapshots'> | Specify directory where snapshots are created. By default, <user home='home'>/Snapshots directory is used. |
quiet | Suppress diagnostics messages that the profiler agent prints to the console. |
help | Print short description of agent parameters. |
Separate multiple options with commas. Pay attention that Java requires : after -Xrunyjpagent but = after -agentlib:yjpagent.
Examples (Java 5 or newer):
java -agentlib:yjpagent FooClass java -agentlib:yjpagent=onexit=memory,dir=c:MySnapshots FooClass java -agentlib:yjpagent=usedmem=70 FooClass
Examples (Java 1.3/1.4):
java -Xrunyjpagent FooClass java -Xrunyjpagent:onexit=memory,dir=c:MySnapshots FooClass java -Xrunyjpagent:usedmem=70 FooClass
Once the YourKit profiler is installed, there's extensive HTML documentation in the installation directory, in <!YourKit Java Profiler Home>/docs/help/index.html. It explains in detail how to integrate the agent library on the target application that is the subject of profiling. It also provides many useful options that can be passed to the agent. For example:
- generate a heap-dump once the application exits
- generate a heap-dump once a certain threshold is reached
These options can be found in <!YourKit Java Profiler Home>/docs/help/agent.html.
The current 7.0 release doesn't come with documentation, you can find it on our setup server:
- setupinstallprofilingyjp-6.0docshelpindex.html
More like this
Jdk Profiler
YourKit has developed a revolutionary approach to profiling applications at both development and production stages, bringing unparalleled benefits to professional Java developers on all platforms, including Windows, Linux, Solaris SPARC/Intel, and. ...
- yjp-7.5.3.exe
- YourKit
- Shareware ($499.00)
- 15.08 Mb
- Windows 2003, XP, 2000, 98, Me
Jensor is a light-weight, low-overhead JavaProfiler built using Java BCI. Jensor provides innovative analysis modules like JVM Replay, Pattern Analysis and Tagging Engine for technical as well as business analysis based on the same underlying. ...
- Jensor_1.13_Installation_Guide.pdf
- jensor
- Freeware (Free)
- 3.65 Mb
- Windows; BSD; Linux
Yet Another JavaProfiler (YaJP) is a profiler tool that uses the JVMTI interface. It can be used to selectively trace a java program and store this information in a compressed logfile. This logfile can then later be analyzed using the same. ...
- yajp-1.0.0-install.jar
- yajp
- Freeware (Free)
- 5.82 Mb
- Windows; Solaris; Linux
Create a high-quality JVM profiler, capable to offer a broad vision of the application performance,focused in locking problems and methods execution Create a high-quality JVM profiler, capable to offer a broad vision of the application performance,focused in locking problems and methods execution time..
- TurboProf - Open Source JavaProfiler
- turboprof
- Freeware (Free)
- 395 Kb
- Windows; BSD; Linux
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_linux_7_0.tar.gz
- ej-technologies GmbH
- Shareware ($499.00)
- 23 Mb
- Linux
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_windows-x64_7_0.exe
- ej-technologies GmbH
- Shareware ($499.00)
- 37 Mb
- Windows Vista, Windows 7 x64
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_linux_6_1_1.tar.gz
- ej-technologies GmbH
- Shareware ($499.00)
- 23 Mb
- Linux
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_windows-x64_6_1_1.exe
- ej-technologies GmbH
- Shareware ($499.00)
- 37 Mb
- Windows Vista, Windows 7 x64
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_macos_7_0.dmg
- ej-technologies GmbH
- Shareware ($499.00)
- 23 Mb
- Mac OS X
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_macos_6_1_1.dmg
- ej-technologies GmbH
- Shareware ($499.00)
- 23 Mb
- Mac OS X
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_windows_7_0.exe
- ej-technologies GmbH
- Shareware ($499.00)
- 38 Mb
- WinXP, Windows Vista, Windows 7
JProfiler is an award-winning all-in-one Javaprofiler. JProfiler's intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues. JProfiler supports the following modes of operation: Live profiling. ...
- jprofiler_windows-x64_6_1_1.exe
- ej-technologies GmbH
- Shareware ($499.00)
- 37 Mb
- Windows Vista, Windows 7 x64
Related:Yourkit Java Profiler - Java Profiler Eclipse - Eclipse Java Profiler - Java Profiler Api - Profiler Java Weblogic