Attaching to a process to collect log records
To attach to a process means that a monitor is created to contain the
results observed by an associated agent. You can attach to a process that
is collecting log records in the same way that you would attach to any other
process.
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.
To either launch or attach either a local or a remote Java process, follow these steps:
- From the Profiling and Logging Perspective, Java Perspective, Server Perspective, or
Debug Perspective, select Profile:

Select either Launch or Attach, then
select Java Process if the process is local or Remote
Process if it is remote.
- If you selected Remote Process, the Hosts page opens.
- Specify either the remote Host name or its IP
address.
- Specify the Agent Controller port, if it's different
from the default. Click Next.
- If you selected Attach, then the Agent window 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.
- If you selected Launch, then the Class window opens.
- Either select the Java Project and Main class that you
intend to profile from within
the workbench or, if you intend to profile classes outside the workbench,
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. Click Next. The Destination page opens.
- 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.
- To select what should and should not be profiled, Select a filter set. Click Next.
The Profiling Options page opens..
- Select the checkboxes to specify whether profiling should Analyze the
application heap and whether it should
Analyze the application execution time. Click Next.
- Specify whether profiling should stop after some number of method invocations or
some amount of time. Click Finish. The profiling
begins:
- The Profiling Console 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, dump object references (click the
Collect Object References button
from the main toolbar).
- If the agent is in the running state but is not collecting data
(shown with the Paused symbol
), using the
Refresh Views button
will not have any
effect. You must start monitoring the agents to get the latest data.
Select Start Monitoring from the pop-up menu of the agent.
- 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 is empty. To populate it, click Refresh Views
.
Related concepts
Overview of the Log and Trace Analyzer
Related tasks
Working with log files
(C) Copyright IBM Corporation 2000, 2003. All Rights Reserved.