Measure Memory Growth
Intel Inspector distinguishes among Memory leak, Memory not deallocated, and Memory growth problem types in the following manner:
Memory leak problems occur when a block of memory is allocated, never deallocated, and not reachable (there is no pointer available to deallocate the block). Severity level = (Error).
Memory not deallocated problems occur when a block of memory is allocated, never deallocated, but still reachable at application exit (there is a pointer available to deallocate the block). Severity level = (Warning).
Memory growth problems occur when a block of memory is allocated, but not deallocated, within a specific time segment during application execution. Severity level = (Warning).
Intel Inspector can measure memory growth to help you ensure an application uses no more memory than expected. This includes:
Memory an application has allocated and still needs for future calculations
Memory an application has allocated and no longer needs, but has not deallocated
Memory an application has allocated and then leaked
Intel Inspector does not perform a reachability analysis on detected Memory growth problems.
To measure memory growth:
Select the Enable memory growth detection checkbox when configuring a memory error analysis.
Run the memory error analysis.
- If desired, click the Reset Growth Tracking button on the Command toolbar to mark the start point of the time period during which you want to measure memory growth. (The default start point is the application start.)
Outcome: The Intel Inspector marks the memory usage graph on the Collection Log pane with a reset request icon.
- When desired, click the Measure Growth button to mark the end point of the time period and measure how much memory has grown since the start point.
Outcome: The Intel Inspector marks the memory usage graph on the Collection Log pane with a measurement request icon and generates a Memory Growth problem that contains a code location for the start marker, for the end marker, and for any block of memory that was allocated, but not deallocated, during the time period.
- Do one or more of the following:
To Do This
Review memory growth.
Click the Summary button to check the Memory growth problem for any code locations other than a start and end marker.
Continue measuring memory growth from the previous start point.
Repeat step 2.
Measure memory growth from a new start point.
Repeat steps 1 and 2.
- When you are finished measuring memory growth, exit the application to end analysis.
Outcome: The Intel Inspector finalizes and displays the result.
For more precision, consider using the GUI-based memory growth detection commands in tandem with APIs for custom memory allocation.
Did you find the information on this page useful?