Products
 
 
 
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 application or applet.

Step 1: Make profiler agent library accessible to the Java Virtual Machine

The action depends on your OS:

Windows, 32-bit Java

add <Profiler Directory>\bin\win32 to the PATH

Windows, 64-bit Java

add <Profiler Directory>\bin\win64 to the PATH

Mac OS X

add <Profiler Directory>/bin/mac to the DYLD_LIBRARY_PATH

Linux x86, 32-bit Java

add <Profiler Directory>/bin/linux-x86-32 to the LD_LIBRARY_PATH

Linux x86, 64-bit Java

add <Profiler Directory>/bin/linux-x86-64 to the LD_LIBRARY_PATH

Solaris SPARC, 32-bit Java

add <Profiler Directory>/bin/solaris-sparc-32 to the LD_LIBRARY_PATH

Solaris SPARC, 64-bit Java

add <Profiler Directory>/bin/solaris-sparc-64 to the LD_LIBRARY_PATH

Solaris x86, 32-bit Java

add <Profiler Directory>/bin/solaris-x86-32 to the LD_LIBRARY_PATH

Solaris x86, 64-bit Java

add <Profiler Directory>/bin/solaris-x86-64 to the LD_LIBRARY_PATH

You can find examples of startup scripts for your platform in <Profiler Directory>/samples

To make sure that Java can load the profiler agent, you can invoke the following command that prints a description of agent parameters:

java -agentlib:yjpagent=help (Java 5 and newer)

java -Xrunyjpagent:help (Java 1.3 and 1.4)

Step 2: Add the appropriate VM parameter to the command line of Java application

The parameter depends on Java version.

With Java 5 or newer (JVMTI API) use -agentlib:yjpagent parameter:

E.g., java -agentlib:yjpagent FooClass

With Java 1.3 or 1.4 (JVMPI API) use -Xrunyjpagent parameter:

E.g., java -Xrunyjpagent FooClass

Startup options

-Xrunyjpagent or -agentlib:yjpagent provides additional startup options. In most cases there's no need to use them.

The options are comma separated: -Xrunyjpagent[:<option>, ...] or -agentlib:yjpagent[=<option>, ...].

Please find detailed description of the startup options here.

Examples:

Java 5 or newer:

java -agentlib:yjpagent FooClass
java -agentlib:yjpagent=onexit=snapshot,dir=c:\MySnapshots FooClass
java -agentlib:yjpagent=usedmem=70 FooClass

Instead of -agentlib:yjpagent, you can specify -agentpath:<full agent library path>. The benefit is that you do not have to alter PATH/LD_LIBRARY_PATH/DYLD_LIBRARY_PATH:

Windows, 32-bit Java:
-agentpath:<Profiler Home>\bin\win32\yjpagent.dll

Windows, 64-bit Java:
-agentpath:<Profiler Directory>\bin\win64\yjpagent.dll

Linux, 32-bit Java:
-agentpath:<Profiler Directory>/bin/linux-x86-32/libyjpagent.so

Linux, 64-bit Java:
-agentpath:<Profiler Directory>/bin/linux-x86-64/libyjpagent.so

Solaris SPARC, 32-bit Java:
-agentpath:<Profiler Directory>/bin/solaris-sparc-32/libyjpagent.so

Solaris SPARC, 64-bit Java:
-agentpath:<Profiler Directory>/bin/solaris-sparc-64/libyjpagent.so

Solaris x86, 32-bit Java:
-agentpath:<Profiler Directory>/bin/solaris-x86-32/libyjpagent.so

Solaris x86, 64-bit Java:
-agentpath:<Profiler Directory>/bin/solaris-x86-64/libyjpagent.so

Mac OS X:
-agentpath:<Profiler Directory>/bin/mac/libyjpagent.jnilib

Java 1.3 or 1.4:

java -Xrunyjpagent FooClass
java -Xrunyjpagent:onexit=snapshot,dir=c:\MySnapshots FooClass
java -Xrunyjpagent:usedmem=70 FooClass

Note: Java requires a colon (:) after -Xrunyjpagent, but an equal sign (=) after -agentlib:yjpagent.

previous      content      next