Launching or attaching a Java process

To profile a process, it needs to be running, an agent needs to be associated with it, and you need to attach to that agent.  If the process is already running, you only need to attach to its agent.  Attach means that a monitor is created to contain the results observed by an associated agent. 

If the process is not running, then you need to launch it.  Launch means that the process is started, an agent is associated with the 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.

Note. The iSeries JVM requires the following options to generate method entry and exit events for method statistics:

      -Dos400.enbprfcol=1 -Djava.compiler=jitc

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

  1. From the Profiling and Logging Perspective, Java Perspective, Server Perspective, or Debug Perspective, select Profile:

     cursor pointing to drop down selector on Profile icon

    Select either Launch or Attach, then select Java Process if the process is local or Remote Process if it is remote.
  2. If you selected Remote Process, the Hosts page opens. 
  3. If you selected Attach, then the Agent window appears, displaying detached (and hence available) agents that are running and collecting data. 
  4. If you selected Launch, then the Class window opens.
  5. Specify the project and monitor in which to store data from this profiling session. You could also specify an external file.  Click Next. The Profiling Filters page opens.
  6. To select what should and should not be profiled, Select a filter set or create a custom one. Click Next.  The Profiling Options page opens..
  7. If you are interested in memory related profiling, such as heap analysis and memory statistics, select My application uses too much memory. 
  8. To analyze application execution, select My application is too slow.  
    1. Click Show Details, then select Show execution flow graphical details to analyze the application execution using the Execution Flow view.  This option also increases the amount of data collected by the profiling session and, in turn, can slow down your application.
    2. Click Next.
  9. Specify whether profiling should stop after some number of method invocations or some amount of time.  Click Finish. The profiling begins:
  10. To analyze data from the profiling session, you can open any available Profiling and Logging view. To refresh the view content, click Refresh Views  A button with stylized icon .


Related concepts
Overview of the Profiling Tool
Profiling resources
Profiling monitor view
Log view

Related tasks
Working with agents
Opening multiple Profiling and Logging Perspectives
Profiling an application in stand-alone mode
Attaching to a running process to collect log records