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:
- Compile the binary with debug options. This configuration is required in order to link the results to source code.
- Create a launch configuration to run your application on the target system.
- In the Launch Configuration dialog, select the Tools tab
- Click Add Tool, to enable the Memory Analysis Tooling option, and then click Ok.
- Expand the Memory Errors folder and deselect all items in the list, except for Perform leak check when process exits.
- Expand the Memory Tracing folder. Ensure that you enable the Enable memory allocation/deallocation tracing option.
- 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.
- Enable the Switch to this tool's perspective on launch option at the bottom of the page.
- 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