Detecting and Isolating Memory Leaks
This page is specific to:.NET Framework Version:1.12.03.54.0
Visual Studio
Detecting and Isolating Memory Leaks

The ability to dynamically allocate and deallocate memory is one of the strongest features of C/C++ programming, but the greatest strength can also be the greatest weakness. This is certainly true of C/C++ applications, where memory-handling problems are among the most common bugs.

One of the most subtle and hard-to-detect bugs is the memory leak — the failure to properly deallocate memory that was previously allocated. A small memory leak that occurs only once may not be noticed, but programs that leak large amounts of memory, or leak progressively, may display symptoms ranging from poor (and gradually decreasing) performance to running out of memory completely. Worse, a leaking program may use up so much memory that it causes another program to fail, leaving the user with no clue to where the problem truly lies. In addition, even harmless memory leaks may be symptomatic of other problems.

Fortunately, the Visual Studio debugger and C run-time (CRT) libraries provide you with effective means for detecting and identifying memory leaks. To understand how to detect memory leaks using the CRT debugging facilities, read the following topics:

MFC provides its own set of facilities for detecting memory leaks in MFC programs. For more information, see Detecting Memory Leaks in MFC.

See Also

Debugging Visual C++

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View