Fully featured low overhead profiler for Java EE
and Java SE platforms.
Easy to use performance and memory profiler for .NET framework.
Supports ASP.NET, Silverlight, .NET Windows services and more.
previous      content      next
Enabling profiling manually

Most likely, you will not need to configure profiling manually. Please first consider the automated ways to enable profiling in your J2SE, J2EE, Java Web Start/JNLP application or applet.

Step 1: 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:

VM option
32-bit Java
-agentpath:<profiler directory>\bin\win32\yjpagent.dll
64-bit Java
-agentpath:<profiler directory>\bin\win64\yjpagent.dll
Mac OS X
-agentpath:<profiler directory>/bin/mac/libyjpagent.jnilib
x86, 32-bit Java
-agentpath:<profiler directory>/bin/linux-x86-32/
x86, 64-bit Java
-agentpath:<profiler directory>/bin/linux-x86-64/
ARMv5, soft-float
-agentpath:<profiler directory>/bin/linux-armv5-sf/
ARMv7, soft-float

-agentpath:<profiler directory>/bin/linux-armv7-sf/

If this ARMv7 agent does not load with your soft-float JVM, try the ARMv5 agent instead and report the case to

ARMv7, hard-float
-agentpath:<profiler directory>/bin/linux-armv7-hf/
ppc, 32-bit Java
-agentpath:<profiler directory>/bin/linux-ppc-32/
ppc64, 64-bit Java
-agentpath:<profiler directory>/bin/linux-ppc-64/
SPARC, 32-bit Java
-agentpath:<profiler directory>/bin/solaris-sparc-32/
SPARC, 64-bit Java
-agentpath:<profiler directory>/bin/solaris-sparc-64/
x86, 32-bit Java
-agentpath:<profiler directory>/bin/solaris-x86-32/
x86, 64-bit Java
-agentpath:<profiler directory>/bin/solaris-x86-64/
IA64, 32-bit Java
-agentpath:<profiler directory>/bin/hpux-ia64-32/
IA64, 64-bit Java
-agentpath:<profiler directory>/bin/hpux-ia64-64/
ppc, 32-bit Java
-agentpath:<profiler directory>/bin/aix-ppc-32/
ppc64, 64-bit Java
-agentpath:<profiler directory>/bin/aix-ppc-64/
x86, 32-bit Java
-agentpath:<profiler directory>/bin/freebsd-x86-32/
x86, 64-bit Java
-agentpath:<profiler directory>/bin/freebsd-x86-64/

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 that prints a description of agent parameters:

java -agentpath:<full agent library path>=help

If JVM reports an error, refer to the knowledge base article for troubleshooting.

Step 2: (Optional) Specify startup options

You can specify additional startup options. In most cases there's no need to use them.

To profile a J2EE server (especially JBoss!), specify startup option delay=10000

The options are comma separated: -agentpath:<full agent library path>[=<option>, ...].


java -agentpath:c:\yourkit\yjpagent.dll FooClass
java -agentpath:c:\yourkit\yjpagent.dll=alloceach=10,allocsizelimit=1000000 FooClass

previous      content      next