Measuring Memory Growth
Intel Inspector
distinguishes among
Memory leak
,
Memory not deallocated
, and
Memory growth
problem types in the following manner:
- Memory leakproblems 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 deallocatedproblems 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 growthproblems 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:
Prerequisites:
- Select theEnable memory growth detectioncheckbox when configuring a memory error analysis.
- Run the memory error analysis.
Steps:
- If desired, click theReset Growth Trackingbutton on theCommandtoolbar 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: TheIntel Inspectormarks the memory usage graph on theCollection Logpane with a reset request icon.
- When desired, click theMeasure Growthbutton to mark the end point of the time period and measure how much memory has grown since the start point.Outcome: TheIntel Inspectormarks the memory usage graph on theCollection Logpane with a measurement request icon and generates aMemory Growthproblem 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 ThisDo ThisReview memory growth.Click theSummarybutton to check theMemory growthproblem 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: TheIntel Inspectorfinalizes and displays the result.
For more precision, consider using the GUI-based memory growth detection
commands in tandem with APIs for custom memory allocation.