Intel® Inspector Help

Evaluation Feature: New Memory Error Analysis Types and Settings

Intel Inspector Changes Under Evaluation

Benefits

Increased number of preset analysis types

Focus analyses on leaks, or memory access problems, or both.

Split configuration setting

Focus analyses on invalid memory accesses, or uninitialized memory reads, or both.

Combined configuration setting and renamed configuration settings

Make configuration options more intuitive.

Increased number of configurable settings

Fine-tune preset analysis types without creating custom analysis types.

Note

Configuration Settings for Each New Preset Analysis Type

The following table shows the configuration settings (in alphabetical order) for each new preset memory error analysis type.

Settings / Analysis Types

Detect Leaks

Detect Memory Access Problems

Detect Leaks and Memory Access Problems

Detect Memory Access Problems (Deep Dive)

Detect Leaks and Memory Access Problems (Deep Dive)

Analyze stack accesses

N/A (No)

No

No

No (configurable)

Yes (configurable)

Defer memory deallocation (previously Byte limit before reallocation)

N/A (No)

No (configurable)

No (configurable)

Yes (configurable)

Yes (configurable)

Detect invalid memory accesses (split from Detect invalid/uninitialized accesses)

No

Yes

Yes

Yes

Yes

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

Yes (configurable)

No

Yes (configurable)

No

Yes (configurable)

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

No (configurable)

No

No (configurable)

No

No (configurable)

Detect uninitialized memory reads (split from Detect invalid/uninitialized accesses)

No

No (configurable)

No (configurable)

Yes (configurable)

Yes (configurable)

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

No (configurable)

No

Yes (configurable)

No

Yes (configurable)

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

No (configurable)

No

Yes (configurable)

No

Yes (configurable)

Guard zone size (previously Guard zone byte size and now combined with Enable guard zones)

N/A (32 bytes)

32 bytes

32 bytes

32 bytes

32 bytes

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

100,000

N/A (100,000)

100,000

N/A (100,000)

100,000

Remove duplicates

Yes

Yes

Yes

Yes (configurable)

Yes (configurable)

Stack frame depth

8 (configurable)

8 (configurable)

8 (configurable)

16 (configurable)

16 (configurable)

Configuration Setting Descriptions

The following table describes all configuration settings available for configuring memory error analyses. The configuration settings are listed in alphabetical order.

Setting

Purpose, Usefulness, Cost, and Recommendation

Analyze stack accesses

Available only if Detect invalid memory accesses and Detect uninitialized memory reads are 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

Available only if Detect invalid memory accesses and Detect uninitialized memory reads 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 memory accesses

Select to detect problems where a read or write instruction references memory that is logically or physically invalid.

Selecting is useful to ensure an application accesses only valid memory.

Medium cost.

Recommendation: Select.

Detect leaks at 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

Available only if Detect memory 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.

Detect uninitialized memory reads

Select to detect problems where a read instruction accesses an uninitialized memory location.

Selecting is useful when an application:

  • Exhibits unexpected behavior.

  • Shows evidence of uninitialized values in computations.

Medium cost.

Recommendation: Select.

Enable 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

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

Available only if Detect invalid memory accesses and Detect uninitialized memory reads are selected.

Set to a number greater than 0 to show offset information if the Intel Inspector detects memory use beyond the end of an allocated block; set to 0 to disable.

A number greater than 0 identifies 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 to a number greater than 0 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 to a number greater than 0 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 memory leaks shown in result

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

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.

Corresponding Command Line Interface Changes

The following table identifies the appropriate <analysis_type> argument for the inspxe-cl collect option.

New Preset Analysis Type Name

Corresponding inspxe-cl <analysis_type> Argument

Detect Leaks

leak

Detect Memory Access Problems

access

Detect Leaks and Memory Access Problems

leak-access

Detect Memory Access Problems (Deep Dive)

access-deep

Detect Leaks and Memory Access Problems (Deep Dive)

leak-access-deep

Various knob names have also changed to better correspond to renamed configuration settings. Use the following inspxe-cl commands to identify available knobs:

For example:

$ inspxe-cl -knob-list leak
$ inspxe-cl -knob-list runmc

Result and Result Directory Name Templates

The following table identifies the default result and result directory name for each preset analysis type.

New Preset Analysis Type Name

Preset Analysis Type Identifier

Parsing Key

Detect Leaks

r@@@ml

m = memory analysis type

l = leak

c = memory access problem

x = deep dive

Detect Memory Access Problems

r@@@mc

Detect Leaks and Memory Access Problems

r@@@mlc

Detect Memory Access Problems (Deep Dive)

r@@@mcx

Detect Leaks and Memory Access Problems (Deep Dive)

r@@@mlcx

State Propagation

When you run an analysis to create a new result, the Intel Inspector automatically propagates state information from a baseline (previous) result to the newer result. By default, the Intel Inspector establishes a baseline result from the immediately previous result of the same analysis type; however, you can establish any baseline result you want (using the Options-State Management dialog box in the GUI or the baseline-result action-option in the inspxe-cl command tool).

To maintain your state assignments when you switch from old preset memory error analysis types to new, choose a baseline result you created from an old preset memory error analysis type (mi1, mi2, or mi3). If you have used multiple preset memory error analysis types, choose the widest (mi1 is the narrowest memory error analysis type; mi3 is the widest).