Performance of heap allocations

Before you begin to profile, your application should run without memory errors. You can use the Momentics IDE for BlackBerry tools to find memory errors.

You can perform heap memory profiling to achieve two goals: performance improvements (because heap memory allocation/deallocation is one of the most expensive ways of obtaining memory), and heap memory optimization. The Memory Analysis tool can assist you with both of these goals.

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. Expand the Memory Tracing folder. Ensure that you enable the Enable memory allocation/deallocation tracing option.
  7. 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.
  8. Enable the Switch to this tool's perspective on launch option at the bottom of the page.
  9. Launch the application.

The Momentics 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 Momentics IDE).

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

Last modified: 2015-03-31

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus