Memory Leak (MLK)

Memory Profiling for C and C++

An MLK message describes leaked heap memory. There are no pointers to this block, or to anywhere within this block.

Memory Profiling generates a list of leaked memory blocks when you activate the MLK Memory Leak option in the Memory Profiling Settings.

This message can occur when you allocate memory locally in some function and exit the function without first freeing the memory. This message can also occur when the last pointer referencing a block of memory is cleared, changed, or goes out of scope. If the section of the program where the memory is allocated and leaked is executed repeatedly, you might eventually run out of swap space, causing slow downs and crashes. This is a serious problem for long-running, interactive programs.

To track memory leaks, examine the allocation location call stack where the memory was allocated and determine where it should have been freed.

You can ignore memory leaks that do not have a call stack, for memory allocations that occur before the application starts by changing the configuration Runtime Analysis > Memory Profiling > Instrumentation control > Only show memory leaks with call stack.

Related Topics

Memory Profiling ResultsWarning MessagesMemory Profiling Settings