Pane: Analysis Type-Memory Errors

Pane position in window

Before Analysis

(One way) To access this pane: Choose File > New > Analysis.... Then choose Memory Error Analysis from the Analysis Type drop-down list.

Use this pane on the Analysis Type window to:

  • Choose and, if necessary, fine-tune a preset memory error analysis type.

  • Configure a memory error analysis to investigate problems in an interactive debugging session.

Tip

  • If the combination of analysis type settings in the preset memory error analysis types does not meet your needs at all, try creating a custom memory error analysis type.

  • Intel Inspector does not offer interactive debugging for the Detect Leaks analysis type because memory and resource leaks are determined after an application terminates and therefore cannot be used to halt execution during analysis. However, you can perform a standard debugger attach to a process launched under this analysis type.

During Analysis

To access this pane: Click the Analysis Type button on the Navigation toolbar.

Use this pane to review the analysis type settings for this analysis run.

After Analysis Is Complete

To access this pane: Click the Analysis Type button on the Navigation toolbar.

Use this pane to:

  • Review the analysis type settings for this analysis run.

  • Re-inspect - run another analysis using the same analysis type settings.

Use This

To Do This

Analysis Type drop-down list

Switch to another category of analysis types.

Configuration slider

Choose a preset analysis type (drag slider).

Analysis Time Overhead gauge

Analysis Time gauge

Quickly estimate the time it may take to collect a result using various preset analyses. Time is expressed in relation to normal application execution time.

For example, 2x - 20x is 2 to 20 times longer than normal application execution time. If normal application execution time is 5 seconds, estimated collection time is 10 to 100 seconds.

Memory Overhead gauge

Memory Overhead gauge

The Memory Overhead gauge helps you quickly estimate the memory the Intel Inspector may consume to detect errors using this preset analysis type. Memory is expressed in blue-filled bars.

Note

The gauge does not show memory used by the running application during analysis.

Copy button

Create a new custom analysis type based on the currently selected analysis type.

Analyze without debugger radio button (Detect Memory Problems and Locate Memory Problems analysis types only)

Select to run an analysis without launching an interactive debugging session. Useful for investigating all types of memory and threading problems.

Tip

You can later use the Debug This Problem function from within a result to launch a new analysis in conjunction with a debugger to stop at problems of interest. The rerun analysis is automatically focused to find the selected problems, making it return to the problems more quickly. The Debug This Problem function is the recommended method for investigating threading errors in an interactive debugging session.

Enable debugger when problem detected radio button (Detect Memory Problems and Locate Memory Problems analysis types only)

Select to allow investigation of every problem detected in an interactive debugging session. Useful for investigating all types of memory problems except memory and resource leaks.

Select analysis start location with debugger radio button (Detect Memory Problems and Locate Memory Problems analysis types only)

Select to allow investigation of problems in a particular area of code during an interactive debugging session. Typical scenario: You need to check for errors in a specific section of application code, but the Intel Inspector does not provide the appropriate granularity to analyze only that code section. This option quickly takes you near that execution point in a debugging session. Useful for investigating all types of memory problems except memory and resource leaks.

Configurable Memory Error Analysis Type Settings

The following list shows the configurable settings (in alphabetical order) for preset memory analysis types. Configurable means you can change the setting without creating a custom analysis type:

  • Analyze stack accesses checkbox (configurable for the Locate Memory Problems analysis type only)

  • Detect leaks at application exit checkbox

  • Detect still-allocated memory at application exit checkbox

  • Enable memory growth detection checkbox

  • Enable on-demand leak detection checkbox

  • Remove duplicates checkbox (configurable for the Locate Memory Problems analysis type only)

  • Stack frame depth drop-down list

Memory Error Analysis Type Settings

Use the Details region to review current analysis type settings. The following table describes the purpose, usefulness, and cost (low, medium, high, or proportional in terms of time and resources) for each memory error analysis type configuration setting. (The settings are listed in alphabetical order.)

Setting

Purpose, Usefulness, and Cost

Analyze stack accesses

Available only if Detect invalid/uninitialized accesses is selected.

Select to analyze invalid and uninitialized accesses to thread stacks.

Selecting is useful when:

  • You want as thorough an analysis as possible.

  • An application calls alloca().

High cost.

Recommendation:

  • Select the first time you analyze an application and periodically thereafter.

  • Select to analyze automatic variables.

Defer memory deallocation (previously called Byte limit before reallocation)

Available only if Detect invalid/uninitialized accesses and Enable enhanced dangling pointer check are selected.

Select to have the Intel Inspector prevent freed memory blocks from immediately returning to the pool of available memory.

Selecting is useful for discovering if an application tries to use memory after freeing it.

High cost if an application is performing many allocations/deallocations.

Recommendation: Select to improve analysis quality if the cost is not too high.

Detect invalid/uninitialized accesses

Select to detect problems where:

  • A read or write instruction references memory that is logically or physically invalid.

  • A read instruction accesses an uninitialized memory location.

Selecting is useful:

  • To ensure an application accesses only valid memory.

  • When an application exhibits unexpected behavior.

  • When an application shows evidence of uninitialized values in computations.

Medium cost.

Recommendation: Select.

Detect leaks at application exit (previously called Detect memory leaks upon application exit)

Select to detect problems where a block of memory is allocated but never released when an application stops executing.

Selecting is useful when an application:

  • Runs out of memory.

  • Appears to be using more memory than expected.

Extremely low cost – especially if used only with Remove duplicates selected.

Recommendation: Select.

Detect still-allocated memory at application exit (previously called Report still-allocated memory at application exit)

Available only if Detect leaks at application exit is selected.

Select to detect problems where a still-reachable block of memory is allocated but not released when the application stops executing.

Cost is proportional to the number of memory blocks still allocated when the application stops executing.

Recommendation: Select to investigate memory growth.

Enable enhanced dangling pointer check

Available only if Detect invalid/uninitialized accesses is selected.

Select to detect if an application is trying to access memory after it was logically freed.

May be higher cost if an application is performing many allocations/deallocations, and the Defer memory deallocation list value is smaller than the amount of memory the application allocates.

Recommendation: Select when an application exhibits unexpected behavior you suspect may be caused by a dangling pointer.

Note

  • Changes application behavior by intercepting calls to deallocators and deferring actual deallocation.

  • Enhanced dangling pointer check is not supported for new/delete and new[]/delete[] allocation/deallocation pairs.

Enable guard zones

Available only if Detect invalid/uninitialized accesses is selected.

Use in conjunction with Guard zone size to show offset information if the Intel Inspector detects memory use beyond the end of an allocated block.

Selecting is useful when:

  • An application exhibits unexpected behavior.

  • You need more context about heap allocations to interpret Invalid memory access problems.

Cost is proportional to number of allocations.

Recommendation: Select unless:

  • Intel Inspector runs out of memory.

  • An application becomes destabilized.

Note

  • May change application behavior.

  • Increases the amount of memory the Intel Inspector uses.

  • Intel Inspector creates guard zones only at the end of allocated space, not at the start of allocated space.

Enable memory growth detection (previously called Enable interactive memory growth detection)

Select to enable the ability to detect if a block of memory is allocated, but not deallocated, within a specific time segment during application execution.

Selecting is useful for modeling memory usage patterns and ensuring a transactional application deallocates all memory allocations after a transaction completes.

Use in conjunction with the Reset Growth Tracking and Measure Growth buttons during analysis.

Low cost.

Enable on-demand leak detection (previously called Enable on-demand memory leak detection)

Select to enable the ability to detect if a block of memory is allocated, but not deallocated and not reachable (there is no pointer available to deallocate the bock), within a specific time segment during application execution.

Selecting is useful for checking for memory leaks in an application that never exits, or in only the portion of an application for which you are responsible.

Use in conjunction with the Reset Leak Tracking and Find Leaks buttons during analysis.

Cost is proportional to the number of allocations.

Guard zone size (previously called Guard zone byte size)

Available only if Detect invalid/uninitialized accesses and Enable guard zones are selected.

Use in conjunction with Enable guard zones to set the number of bytes beyond the allocated block of memory the Intel Inspector reserves to identify Invalid memory access problems related to the allocation.

Setting is useful when:

  • An application exhibits unexpected behavior.

  • You need more context about heap allocations to interpret Invalid memory access problems.

Cost is proportional to number of allocations.

Recommendation: Set unless:

  • Intel Inspector runs out of memory.

  • An application becomes destabilized.

Note

  • May change application behavior.

  • Increases the amount of memory the Intel Inspector uses.

  • Intel Inspector creates guard zones only at the end of allocated space, not at the start of allocated space.

Maximum number of leaks shown in result (previously called Maximum memory leaks)

Use to set the maximum number of leaks the Intel Inspector shows in a result after analysis is complete.

A zero setting shows all detected memory leaks.

Cost is proportional to the number of leaks.

Recommendation: Use the default value unless you want an exhaustive list of all leaks.

Tip

Even the default value can generate an unmanageable number of leaks. Consider sorting the displayed memory leaks by Object Size, fixing the largest leaks, and then re-inspecting your application. Or use the on-demand leak detection feature to narrow your focus and eat the elephant one bite at a time.

Remove duplicates

Deselect to show all occurrences of a detected problem in the Code Locations pane.

Deselecting is:

  • Useful when you need to fully visualize all threads and problem occurrences in relation to time

  • Low cost in terms of time; however, the number of duplicate errors could crowd out the number of unique errors.

Recommendation: Select.

Stack frame depth

Use to provide more or less call stack context for detected errors.

A high setting is useful when analyzing highly object-oriented applications.

A higher number does not significantly impact cost.

Recommendation: Use only as large a value as an application requires to display complete call paths.

See Also


Supplemental documentation specific to a particular Intel Studio may be available at <install-dir>/<studio>/documentation/.

For more complete information about compiler optimizations, see our Optimization Notice.