Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Studio Debugger 
Memory Leak Detection in MFC 

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Express

No

No

Native

No

Standard

No

No

Native

No

Pro/Team

No

No

Native

No

MFC provides classes and functions for detecting memory that is allocated but never deallocated.

In This Section

Tracking Memory Allocations

Discusses the DEBUG_NEW macro, which you can use to locate memory leaks. Information includes considerations in Debug and Release versions, defining the macro in your source files, and object dumps.

Enabling Memory Diagnostics

Provides steps for enabling diagnostic tracing and selecting specific memory diagnostic features with afxMemDF (for more precise control).

Taking Memory Snapshots

Shows how to take snapshots of memory to help locate memory leaks.

Viewing Memory Statistics

Describes the CMemoryState::Difference function (compares memory) and the CMemoryState::DumpStatistics (prints memory statistics) and provides code examples.

Object Dumps

Provides information on object dumps, including the DumpAllObjectsSince function, example code, and considerations, as well as interpreting and customizing object dumps.

Related Sections

Detecting and Isolating Memory Leaks

How to use the C run-time library to detect memory leaks.

MFC Debugging Techniques

Links you to debugging techniques for MFC programs, including: afxDebugBreak, the TRACE macro, detecting memory leaks in MFC, MFC assertions, and reducing the size of MFC Debug builds.

Debugging Visual C++

Discusses some common debugging problems and techniques for C and C++ applications.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
CMemoryState and debug output unavailable in Windows Mobile      jaybo_nomad   |   Edit   |   Show History
Note that CMemoryState and dumping of leaked memory at program termination isn't availabe AT ALL under Windows Mobile.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2010 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker