Memory Growth

Occurs when a block of memory is allocated but not deallocated within a specific time segment during application execution.

Problem type: Memory growth

Problem type: Memory growth

Problem type: Memory growth

ID

Code Location

Description

1

Start site

Represents a point in time.

2

Allocation site

Represents the location and associated call stack of a memory block allocated but not deallocated between the start site and end site. There may be no, one, or many allocation site code locations in a Memory growth problem.

3

End site

Represents a point in time.

Note

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).

Example

void ProcessTransaction(TransactionContext x)
{
   ...
   char* m = (char*) malloc(128);
   ...
   return;
}

void WaitForTransactions()
{
   ...
   for (;;)
   {
      TransactionContext x = WaitForTransaction(); // Report end site
      ProcessTransaction(x);
   }
}

In this example, if the user clicks the Reset Growth Tracking button, performs the transaction, and then clicks the Measure Growth button, the Intel Inspector reports a single allocation of 128 bytes within ProcessTransaction.

Possible Correction Strategies

Identify the leaked memory blocks that should have been freed and call the appropriate free routine during the lifetime of the transaction.

Note

Intel Inspector does not perform a reachability analysis. Some of the reported memory blocks may:

  • Be already unreachable

  • Become unreachable later

  • Be deallocated later

  • Be still allocated but reachable when analysis ends


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.