Prepare for a memory profiling session

To prepare for a memory profiling session:

  1. Compile the binary with debug options. This configuration is required in order to link the results to 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, and 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 perform a verification for memory leaks.
    Note: It is sufficient to check only once each time you run the application because the leaks would be duplicated, and the leak detection process itself takes a significant amount of time to complete.
  7. Expand the Memory Tracing folder. Ensure that you enable the Enable memory allocation/deallocation tracing option.
  8. Expand the Memory Snapshots tab. Ensure that you enable the Memory Snapshots option, and type an interval for the snapshots for your application (i.e., 10 to 20 snapshots during the entire application execution).
  9. If you use custom shared libraries, expand the Library search paths tab, and specify information so that the tool can also read 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 stop it (either it should terminate itself or you can stop it from IDE).

Now, the Memory Analysis session will be ready, and we can begin to inspect the results.