Please enable JavaScript to view this site.

Memory Validator Help

Navigation: Overview

What does Memory Validator do?

Scroll Prev Top Next More

Memory Validator provides functionality to detect memory leaks and resource leaks in 32 and 64 bit programs running on Windows NT® 4.0 and above.

 

 

Memory leaks

 

Memory leaks (allocations without a corresponding deallocation) are detected in the following:

 

Functions

 

new 

malloc 

calloc 

realloc 

_expand 

LocalAlloc 

LocalRealloc 

GlobalAlloc 

GlobalRealloc 

HeapAlloc 

HeapReAlloc 

VirtualAlloc 

VirtualAllocEx 

IMalloc 

CoTaskMemAlloc 

CoTaskMemReAlloc 

SysAllocString

 

NetApi function group 

Miscellaneous other memory allocation functions

 

COM objects

 

COM leaks

 

User defined

 

User defined heaps (requires linking with svlMemoryValidatorStubLib.lib / svlMemoryValidatorStubLib_x64.lib to access this functionality)

User defined reference counted objects (requires linking as above)

Reference counting for user managed heaps.

Memory leaks from user managed heaps.

 

Potentials

 

Potentially unused memory.

Potentially leaked memory.

 

Learn more about memory management on Windows at the MSDN Dev CenterexternalLink.

 

 

Resource leaks

 

Resource leaks are detected - typically handles that are not closed.

 

 

Memory usage errors

 

Memory usage errors are typically the result of passing the wrong pointer to a deallocation or reallocation function, or attempting to deallocate memory more than once.

 

Examples detected include:

 

Incorrect memory freeing - e.g. freeing a pointer not allocated from the appropriate heap

Allocate with malloc() - then deallocate with delete or delete []

Allocate with calloc() - then deallocate with delete or delete []

Reallocate with realloc() or _expand() - then deallocate with delete or delete []

Allocate with new - then deallocate with free()

Allocate with new - then reallocate with realloc() or _expand()

Multiple memory freeing - e.g. freeing the same pointer more than once

 

 

Memory corruption

 

Heap overruns - writing past the end of an allocated heap block

Heap underruns - writing past the start of an allocated block

Heap corruption - heap getting damaged by heap overruns, heap underruns and wild pointer writes

Stack overruns - writing past the end of the current stack frame

Stack underruns - writing past the start of the current stack frame

 

 

Uninitialized data

 

Uninitialized data in C++ objects.

Detection of C++ objects that do not initialise all their member variables.

 

 

COM object tracking

 

Memory Validator can hook AddRef(), Release() and QueryInterface() so that it can track the reference counts for COM objects.

 

 

.Net memory and .Net handles

 

Memory Validator uses the .Net ICorProfiler and ICorProfilerCallback interfaces to monitor .Net applications.