User Guide

  • 2020
  • 09/09/2020
  • Public Content
Contents

Memory Not Deallocated

Occurs when a block of memory is allocated, never deallocated, but still reachable at application exit (there is a pointer available to deallocate the block).
Problem type: Memory not deallocated
ID
Code Location
Description
1
Allocation site
Represents the location and associated call stack from which the memory block was allocated.
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 severity icon (
    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 severity icon (
    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 severity icon (
    Warning
    ).
static char *pStr = malloc(512); return;
integer, allocatable, save, dimension(:) :: notdeallocatedptr(:) allocate(notdeallocatedptr(200))
Possible Correction Strategies
Use the appropriate deallocation function to return the memory block to the heap after its last use.
Platform
Memory Allocator
Memory Deallocator
C++ language
new
operator
delete
operator
new[]
operator
delete[]
operator
C language
malloc()
,
calloc()
, or
realloc()
functions
free()
function
Fortran language
allocate()
function
deallocate()
function
Windows* API
Windows* dynamic memory functions such as
GlobalAlloc()
or
LocalAlloc()
Appropriate functions, such as
GlobalFree()
or
LocalFree()

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804