Attaching to a server in profiling mode
After the server has succesfully started in profiling mode, the Attach wizard opens. It then allows you to attach to the server and to set the profiling options and filters.
Attaching to a server means that a monitor is created to contain the results observed by an associated agent.
To attach to the server started in profiling mode, follow these steps:
- If the server's process ID could not be determined automatically (only WAS 6 supports this), the Agents tab appears, displaying detached (and hence available) agents that are running and collecting data.
- Select the agents that are associated with the process IDs you wish to attach to and move them to the right side pane.
- It may be useful to click Refresh to ensure that you have an up-to-date list. Click Next.
- Under the Profiling tab, there are 3 sub-tabs used to specify profiling options:
- Under the Overview sub-tab, select the profiling set (e.g. Memory Analysis) that is most appropriate. If the options need to be refined further, you may create a new profiling set, or edit an existing one. In order to change the filtering of packages and classes, edit the profiling set.
- Under the Limits tab, you can set limits to the amount of profiling data collected. You may specify a maximum number of method invocations, or a time duration after which no profiling data will be collected.
- Under the Destination tab, you can specify where the profiling data will be stored after being collected. Specify the project and monitor names under which to store the data. If you wish to store the results to a file for later viewing (via the Import- Profiling file action), check the "Send profiling data to a file" box and specify the full path of the file. Note: When profiling to a file, no data will be shown in the views. To view the data, import the profiling file into your workspace.
- Click Finish. The profiling begins:
- The Console view opens, displaying program input and output.
- The associated agents monitor the application (shown with the Monitoring symbol ) until it has run to completion.
- Profiling objects are created and displayed in the Profiling Monitor, and are identified both by name and a process ID number (PID). This workbench process object is a logical representation of the selected Java process; it is not a system process.
- In the monitored state, you can run garbage collection (click the Run Garbage Collection button ) or, if available, collect object references (click the Collect Object References button from the main toolbar).
- You must start monitoring the agents to get profiling data. To start collecting profiling data, Select Start Monitoring from the pop-up menu of the agent. Click Refresh Views to refresh the views with the latest data collected from the application being profiled.
- If the agent is in the terminated state (shown by the Terminated symbol ), it means that it has finished monitoring the application, which has run to completion.
- To analyze data from the profiling session, you can open other Profiling and Logging views. When you first open a view, it may be empty. To populate it, click Refresh Views .