Changing memory profiling settings

You can edit the configuration settings for memory profiling to specify the errors and warnings that you want to detect and to set other advanced options.

Procedure

To change the memory profiling settings:

  1. In the project explorer, right-click the project on which you want to change the settings and click Properties.
  2. Click C/C++ Build > Settings and select Build Settings.
  3. Expand Memory profiling to access the settings and set the error and warning detection options as well as any other required options. The following settings are available:
    Instrumentation control
    You can specify the type of memory errors and warnings that you want to detect. See Memory profiling errors and Memory profiling warnings for more information about these settings.
    Detect File in Use (FIU)
    When the application exits, this option reports any files left open.
    Detect Memory in use (MIU)
    When the application exits, this option reports allocated memory that is still referenced.
    Free Invalid Memory (FIM)
    This option activates the detection of invalid free memory instructions.
    Detect Signal (SIG)
    This option indicates the signal number received by the application forcing it to exit.
    Detect Freeing Freed Memory (FFM) and Detect Free Memory Write (FMWL)
    Select Yes to activate detection of these errors.
    Free queue length (blocks)
    Specifies the number of memory blocks that are kept free.
    Free queue size (bytes)
    Specifies the total buffer size for free queue blocks.
    Largest free queue block size (bytes)
    Specifies the size of the largest block to be kept in the free queue.
    Detect Array Bounds Write (ABWL)
    Select Yes to activate detection of ABWL errors.
    Red zone length (bytes)
    Specifies the number of bytes added by Memory Profiling around the memory range for bounds detection.
    Number of functions in call stack
    Specifies the maximum number of functions reported from the end of the CPU call stack. The default value is 6.
    Only show memory leaks with call stack
    Select this option to only record memory leaks that are associated with a call stack. Memory allocations that occurred before the application started do not have a call stack and are not included in the Memory Profiling report.
    Line number link
    Select Statement to link the line number in the report to the corresponding allocation or free statement in the function. Select Function to link only to the function entry and to improve performance.
    Only show new memory leaks in each dump
    In multi-dump report, Memory leaks (MLK) and potential leaks (MPK) are only reported once.
    Advanced options
    Trace File Name (.tpf)
    This setting allows you to specify a filename for the generated .tpf trace file.
    Exclude block tracking before init
    Disables memory profiling for any memory blocks allocated before the first execution of instrumented code. Use this option to prevent crashes when the system uses memory allocations that cannot be tracked.
    Excluded global variables
    Specifies a list of global variables that are not to be inspected for memory leaks. This option can be useful to save time and instrumentation overhead on trusted code. Use the Add and Remove buttons to add and remove global variables.
    Exclude variables from directories
    Specifies a list of directories from which any variables found in files are not to be inspected for memory leaks.
    Break on error
    Use this option to break the execution when an error is encountered. The break point must be set to priv_check_failed in debug mode.
    ABWL and FMWL check frequency
    Use this to check for ABWL and FMWL errors:
    • Each time the memory is dumped (by default).
    • Each time a manual check macro is encountered in the code.
    • Each function return.
    These checks can be performed either on all memory blocks or only a selection of memory blocks. See Checking for ABWL and FMWL errors for more information.
    Preserve block content
    Set this setting to Yes to preserve the content of memory blocks freed by the application. Use this setting to avoid application crashes when memory profiling is engaged. When this setting is enable, reads to freed blocks of memory are no longer detected.
  4. Click OK, Apply the changes and close the Properties window.
Feedback