Launching or attaching to a process for profiling

The Profiling Tool provides the ability to attach to a running application or to launch an application for profiling.
Attaching to an application is a feature where you can associate with an already Java process enabled for profiling.
Launching a process means that the process is started with an agent associated with its launch.

Whenever you launch or attach to a Java process, a logical representation of the Java process is created in the Profiling Monitor view. This representation, the process object, is identified both by name and an identification number (process identifier (PID)) that appears in the view along with the associated agents.

Attaching to an application

Important: before being able to attach to a profiling agent, a Java process will need to be running in controlled or enabled mode. Click here to find more details about how an application can be executed in controlled or enabled mode.
  1. From the Profiling and Logging Perspective, click on the Profile profiling icon drop-down menu, and select Profile Configurations... The Profile wizard opens.
  2. Double click on Attach to Agent. A new configuration is created.
  3. Under the Host tab, specify the Host name or IP address and the Agent Controller port (if different from the default).
  4. Switch to the Agents tab to view a list of available agents that can be attached to (Note: if the list is empty then no agents are available to attach to on the selected host. You can always use the Refresh button to get the list of available agents)
  5. Check the analysis types that you wish to use to attach to the available agent. Configure the profiling filters as required. Refer to the Specifying profiling criteria topic for more information on configuring the profiling filters.
  6. Click Apply to apply the changes.
  7. Click Profile to attach to the application.
  8. The Profiling Monitor view is refreshed displaying the agent representing your application.

Launching an application

To either launch a local or a remote Java process, follow these steps:

  1. From the Profiling and Logging Perspective, click on the Profile profiling icon drop-down menu, and select Profile Configurations... The Profile wizard opens.
  2. There are several types of Java processes that can be launched:
  3. Select the Profile Settings tab. Configure the profiling filters as required. Refer to the Specifying profiling criteria topic for more information on configuring the profiling filters.
  4. Click Apply to apply the changes.
  5. Click Profile to attach to the application.
  6. The Profiling Monitor view is refreshed displaying the agent representing your application. The workbench console opens, displaying program input and output.

Once your application is being profiled, you can perform a number of other data collection activities on the application such as collecting object references and garbage collection.

Related concepts
Overview of the Profiling Tool
Profiling resources

Related tasks
Collecting object references*

Object Allocation Analysis and Memory leak detection**

Studying garbage collection for Java 1.4 and lower jvm*

Studying garbage collection for Java 5.0 (Java 1.5) and higher jvm**

Thread analyzer**

Profiling an application in stand-alone mode

Profiling with a local deployment

Specifying profiling criteria

Using the Profiling Monitor view

*Supported for Java 1.4 and lower java profiling

** Support for profiling Java 5.0 (also referred to as Java 1.5) and above java virtual machines.