Attaching to a running process

If you launch an application on a target system without using the IDE, you can still attach the Memory Analysis tool to one of its processes and view the process' memory data, provided that you ran the application with Memory Analysis enabled. For instructions on doing this from the command line, see Launching from the command line with Memory Analysis.
To attach to a running process, you need to create a "profile" launch configuration as follows:
  1. If the Run menu doesn't include a Profile entry, add it like this:
    1. Select Customize Perspective from the Window menu.
    2. Select the Command Groups Availability tab.
    3. In the list of checkboxes, ensure that the Profile checkbox is enabled.
    4. Click OK.
  2. Choose Run > Profile Configurations.
  3. Add the Memory Analysis tool to the configuration, as described in Steps 2 to 4 in the instructions on launching with Memory Analysis enabled.
  4. In the Memory Analysis tab, configure the settings for your program by expanding the groups and setting the various fields as needed.

    You should ensure that the log file (or MALLOC_FILE) value, which you used when launching the process, is the same in the Advanced Settings section.

    For a reference of all UI fields you can set, see Configuring Memory Analysis sessions.

  5. Click Profile to launch the tool.
    After launching, a dialog appears with a list of all running processes on the target.
  6. Choose the process you want to attach to and click OK.
The IDE creates a new Memory Analysis session. The new session is listed in the Session View and you can select it to view the process' memory usage and error data.