Attaching to a Local Application

See Also

You can use the attach mode to profile a local application when you want or need to start the application outside of the IDE. For example, you may want to use the attach mode in the following cases:

To attach to a local application, you first need to configure the attachment settings using the Attach Settings dialog box. These settings are associated with the project you are profiling. You only need to configure the attach settings for your project once, but you can modify the settings at any time in the Attach Settings dialog box.

When you configure the settings for attaching to a local application, you can choose from the following attachment modes:

Perform the following steps to attach to a local application.

  1. Choose Profile > Attach Profiler ( Attach Profiler icon ) from the main menu to open the Attach Profiler dialog box.
  2. Select the target application from the Attach To drop-down list at the top of the dialog box.
  3. Click define to open the Attach Settings dialog box to specify the connection method.
  4. Select Local as the Attach Method.
  5. Select either Direct or Dynamic as the connection method.
  6. Follow the instructions in the Attach Settings dialog box for configuring the application, if necessary. Click OK.
  7. In the Attach Profiler dialog box, select a profiling task and any options.
  8. Click Attach.

To detach from the application:

When you detach from the application, the connection to the target JVM is closed. When you click Detach, you can choose to stop the application upon detach or allow the application to keep running. You can re-attach to the application by choosing Profile > Attach Profiler from the main menu.

Modifying the profiling task

Once the connection is established and the profiler is attached to the target application, you can change the profiling task you are running on the target application without stopping or restarting the application.

To change the profiling task without detaching:

  1. Choose Profile > Modify Profiling Session (Alt+Shift+F2) from the main menu or click Modify Profiling Session ( Modify Profiling Session icon ) in the Profiler window.
  2. Select a new profiling command and adjust any settings.
  3. Click Run.

The target application is instrumented again without starting or stopping the application.

See Also
Profiling Using Attach Mode

Legal Notices