When does Purify scan for memory leaks? (Error Detection)

By default, Purify scans for memory leaks, including all Win32 heaps and C Runtime heaps, when you exit a program. If you want Purify to scan for leaks more often, use one of these Purify API functions: PurifyNewLeaks, PurifyAllLeaks, or PurifyNewInuse.

When you exit a program, the HeapDestroy API causes a leak scan to occur before the indicated heap is erased. While HeapDestroy does clean up all of the memory in the indicated heap, there could still be a recurring leak in a module that is called by your program; in a .dll or ATL code, for example.

Since Purify only performs the HeapDestroy leak scan when you exit a program, it might make sense to do the scan more or less often depending on your requirements. You can control when Purify does a HeapDestroy leak scan by specifying /HeapDestroyLeakScan in Additional options in the Files tab in the settings dialog boxes with the following values:

0

Scan heaps on exit only. This is the default.

1

Scan on every heap destroy.

2

Never scan on heap destroy.

(C) Copyright IBM Corporation 1992, 2010.