Remote Profiling

Use remote profiling to connect to a profiled application running at a remote computer.

I. Copy Agent files to the remote host

Before you start remote profiling, the Profiler agent file that corresponds to the remote host's OS and Java version must be copied from the Profiler installation\plugins\xxx directory to the remote host.
  • Native agent file

            For Java 1.5 and above:
    • agent.dll for Windows - located under \plugins\com.instantiations.jvmti.agent.win32.x86_xxx
    • agent.so for Linux - located under \plugins\com.instantiations.jvmti.agent.linux.x86_xxx
    • agent.jnilib for Mac OS

           For Java 1.4: See the limitations when using JVMPI.

    • jvmpi-agent.dll for Windows - located under \plugins\com.instantiations.jvmpi.agent_xxx
    • libjvmpi-agent.so for Linux - located under \plugins\com.instantiations.jvmpi.agent.linux.x86_xxx
  • Java agent file

    Java 1.5 and above: agent.jar - located under \plugins\com.instantiations.jvmti.agent_xxx
    Java 1.4: jvmpi-agent.jar - located under \plugins\com.instantiations.jvmpi.agent_xxx

Note: If you use Java 1.4 the VM attempts to locate a profiler agent library (native agent file) in the Java's library directory (C:\Program Files\Java\j2re1.4.2_16\bin\ on Windows or /opt/j2re1.4.2_16/lib/i386/ on Linux).  If the library is not found in the Java library directory, the VM continues to search for the library following the normal library search mechanism of the given platform. On Windows, the VM searches the current directory, Windows system directories, and the directories in the PATH environment variable. On Linux, the VM searches the directories in LD_LIBRARY_PATH. Please see http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/jvmpi.html#start_up for details. So the native agent file (jvmpi-agent.dll or libjvmpi-agent.so) should be located in one of mentioned above directories.

To run a remote application with the CodePro Profiler, you need to create a Remote Profiling launch configuration. 

II. Set Up Launch Configuration

1. Select  Remote Profiling from the drop-down menu of the Profile toolbar action to open the launch configuration dialog.

2. Specify launch configuration settings in the dialog.

Remote Profiling Settings:

  • Java version - Specify the Java version being used on the remote host (>=1.5 or <1.5). 
  • Get port automatically - Check this option if you want Profiler to get the port automatically. 
  • Port - Specify the port where the Profiler will listen to to get information from the agent on the remote host. 

         For more information on Memory Profiling Settings, CPU Settings etc... see the Setting Up Launch Configuration topic.


3. Press the Profile With CodePro button.

The following dialog should be shown

For Java 1.5 or higher:

For Java 1.4:

Press the Cancel button if you want to stop the remote profiling session.

4. Run the application at the remote host in profile mode.

The Profiling perspective opens automatically after the profiled application with necessary VM arguments ran at the remote host. 

III. Run the application on the remote host in Profile mode.  

1. Find out the path (see file location described above) to the native agent file (for Java 1.5 and higher):
  • agent.dll for Windows
  • agent.so for Linux
  • agent.jnilib for Mac OS

2. Find out the path to the *.jar file.

  • agent.jar for Java 1.5 and higher
  • jvmpi-agent.jar for Java 1.4
3. Add the following string to the VM arguments before running the application:

Java 1.5 or higher (Windows)

-agentpath:<NATIVE-AGENT-PATH-HERE>agent=mode=2,port=1235,host=192.168.
1.101,telemetryInterval=500,samplingInterval=100,jpp=<JAR-PATH-HERE>age
n
t.jar

Java 1.5 or higher (Linux)

-agentpath:<NATIVE-AGENT-PATH-HERE>agent.so=mode=2,port=1235,host=192.168.
1.101,telemetryInterval=500,samplingInterval=100,jpp=<JAR-PATH-HERE>age
nt.jar

Java 1.4

-Xrunjvmpi-agent:mode=61,port=1235,host=192.168.1.101,telemetryInterval=
250,samplingInterval=1 -Xbootclasspath/a:<JAR-PATH-HERE>jvmpi-agent.jar


4. Run the application on the remote host using the JVM arguments described above.