Launching or attaching to an application 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 means that a monitor is created to contain the results observed by an associated agent.
Launching a process means that the process is started with an agent is associated with to process, and a monitor is created to contain the results observed by the agent.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 ID number (PID) that appears in the view along with the associated agents.
Attaching to an application
- From the Profiling and Logging Perspective, click on the Profile
icon, and select Profile. The Profile wizard opens.
- Double click on Attach - Java Process. A new configuration is created.
- Under the Host tab, specify the Host name or IP address and the Agent Controller port (if different from the default).
- Select the agents that are associated with the process ID you want to attach to.
- Use the arrow keys to select the agent.
Hint: Click Refresh at any time to get a list of agents.- Select the Profiling tab. Configure the profiling filters as required. Refer to the Specifying profiling criteria topic for more information on configuring the profiling filters.
- Click Apply to apply the changes.
- Click Run to attach to the application.
- The Profiling Monitor view is refreshed displaying the agent representing your application. The Profiling Console opens, displaying program input and output.
Launching an application
To either launch a local or a remote Java process,...
- From the Profiling and Logging Perspective, click on the Profile
icon, and select Profile. The Profile wizard opens.
- There are several types of Java processes that can be launched:
- To launch a Java Application,...
- Double click on Java Application. A new configuration is created.
- Select the Java Project and Main class that you intend to profile.
- In the Arguments tab, enter any Program arguments and/or VM arguments that you want this configuration to use.
- To launch an external Java Process,...
- Double click on External Java Application. A new configuration is created.
- On the Host tab, specify the Host name or IP address and the Agent Controller port (if different from the default). Click Add, then switch to the Main tab.
- Select the Java Class on the file system.
- You may need to specify where to find the Class path, directory, and JAR file.
- You may specify Parameters, VM arguments, and Environment Variables, as needed.
- To launch an Eclipse runtime workbench,...
- Double click on Run-time Workbench. A new configuration is created.
- On the Arguments tab, change the arguments that are used to launch the runtime workbench, or accept the defaults and select the Plug-ins tab.
- The Plug-ins tab provides the opportunity to select the plug-ins that will be loaded on start-up on the runtime workbench. Make all necessary changes (or accept the defaults), and click on the Tracing tab.
- On the Tracing tab, you may modify tracing flags used by plug-ins.
- Select the Profiling tab. Configure the profiling filters as required. Refer to the Specifying profiling criteria topic for more information on configuring the profiling filters.
- Click Apply to apply the changes.
- Click Run to attach to the application.
- The Profiling Monitor view is refreshed displaying the agent representing your application. The Profiling 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.
Note. The iSeries JVM requires the following options to generate method entry and exit events for method statistics:
-Dos400.enbprfcol=1 -Djava.compiler=jitcRelated concepts
Overview of the Profiling Tool
Profiling resources
Profiling monitor view
Related tasks
Profiling an application in stand-alone mode
Specifying profiling criteria