## Starting a Profiling Session

See Also

If you have a project that is targeted to run on your local machine, you can profile the project without any additional configuration. When you profile a local project, you launch the project and start the profiling session from within the IDE.

- If you want to profile a local application but you cannot or do not want to start the application from the IDE, you can profile the application by attaching the IDE to the application.

To profile a local project, the project must be open in the IDE. Each of the following profiling commands in the Profile menu invoke a dialog box where you select the profiling task for the session. You can start the profiling session after you select the profiling task.

Command | Description
--- | ---
Profile > Profile Main Project | Opens the Select Profiling Task dialog box. The selected task is run on the main project.
Profile > Attach Profiler | Opens the Attach Profiler dialog box. In the Attach Profiler dialog box, you select the project, the profiling task and the mode for attaching to the application. Use this to profile remote applications, running local applications, or applications that you start outside the IDE.
Profile > Profile Other > "projectname" | Opens the Select Profiling Task dialog box. The selected task is run on the selected project.

Notes:

- Before you can use the profiler in the IDE, you need to calibrate the profiler. You only need to calibrate the profiler once.
- The first time you profile a project, the IDE needs to modify the project build script to integrate the profiler. The IDE creates a backup of your project build script before it performs the modifications.

### To profile the Main Project

1. Choose Profile > Profile Main Project from the main menu.
2. Select a profiling task in the Select Profiling Task dialog box.
3. Specify any options for the task.
4. Click Run.

When you click Run, the IDE launches the main project and opens the Profiler window.

### To profile an individual project

1. Right-click a project in the Projects window and choose Profile Project.

   Alternatively, select a file in the project and choose Profile > Profile Other > Profile Project "projectname" from the main menu.

2. Select a profiling task in the Select Profiling Task dialog box.
3. Specify any options for the task.
4. Click Run.

### To profile a specific class:

1. In the Projects window, select the class you want to profile. (This class must contain a runnable method.)
2. Choose Profile > Profile Other > Profile "filename" from the main menu.
3. Select a profiling task in the Select Profiling Task dialog box.
4. Specify any options for the task.
5. Click Run.

When you click Run, only the selected class is launched.

- To profile a project or file, the project build script needs to be modified to import a profiling build script. If the build script does not contain the profiling import task, the IDE modifies the build script and creates a backup copy of the original build script. You can revert the modifications and remove the profiling import task by choosing Profile > Advanced Commands > Unintegrate Profiler from project-name.

See Also
  Monitoring an Application
  Analyzing CPU Performance
  Analyzing Application Memory Usage
  About Profiling Results
  Profiling Using Attach Mode

Legal Notices