Preparing for memory profiling

To prepare for a memory profiling session:

  1. Compile the binary with debug options.
    This configuration is required in order to match the results with source code.
  2. Create a launch configuration to run your application on the target system.
  3. In the Launch Configuration dialog, select the Tools tab.
  4. Click Add Tool to enable the Memory Analysis Tooling option, then click Ok.
  5. Expand the Memory Errors folder and deselect all items in the list, except for Perform leak check when process exits.
  6. If your process never exits, edit the Perform check every (ms) option and specify an interval in milliseconds.
    This value will be used to periodically check for memory leaks.
    Note: It is sometimes sufficient to check only once each time you run the application because the leaks might be duplicated, and the leak detection process takes significant time.
  7. Expand the Memory Tracing folder and enable the Enable memory allocation/deallocation tracing option.
  8. Expand the Memory Snapshots tab, enable the Memory Snapshots option, and type an interval for the snapshots for your application (e.g., 10 to 20 snapshots during the entire application execution).
  9. If you use custom shared libraries, expand the Library search paths tab and specify paths so that the tool can also read the necessary symbol information from the libraries.
  10. Enable the Switch to this tool's perspective on launch option at the bottom of the page.
  11. Launch the application.

The IDE switches to the Memory Analysis perspective. A new session is displayed in the Session View. Let the application run for a desired amount of time (you may perform a testing scenario), and then either stop it from the IDE or let it terminate itself.

Now, the Memory Analysis session will be ready and you can inspect the results.