Memory Leaks and False Positives

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not applyTopic does not apply

Native only

Topic does not apply

Standard

Topic does not applyTopic does not apply

Native only

Topic does not apply

Pro and Team

Topic does not applyTopic does not apply

Native only

Topic does not apply

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

Command or commands hidden by default.

In some cases, _CrtDumpMemoryLeaks can give false indications of memory leaks. This can occur if you use a library that marks internal allocations as _NORMAL_BLOCKs instead of _CRT_BLOCKs or _CLIENT_BLOCKs. As a result, _CrtDumpMemoryLeaks is unable to tell the difference between user allocations and internal library allocations. If the global destructors for the library allocations run after the point where you call _CrtDumpMemoryLeaks, each internal library allocation is reported as a memory leak. Older versions of the Standard Template Library, prior to Visual Studio .NET, caused _CrtDumpMemoryLeaks to report such false positives, but this has been fixed in recent releases.

Community Additions

ADD
Show: