Memory leak options

 

Option

Default

-inuse-at-exit

no

Specifies whether memory in use is reported at program exit. Memory in use is memory that has been allocated and to which there are still pointers.

Use -inuse-at-exit=yes to print in-use messages at exit.

 

-leaks-at-exit

yes

Specifies whether memory leaked is reported at program exit. Memory leaked is memory that has been allocated and to which there are no pointers.

Use -leaks-at-exit=no to suppress printing memory leak messages at exit.

 

-pointer-mask

0xffffffff (32-bit)
0xffffffffffffffff (64-bit)

Specifies a mask that lets Purify extract the correct value from custom pointers.

Normally, if your application ORs flags into the upper bits of heap pointers, Purify cannot follow them to the memory blocks they refer to and might incorrectly report leaks. For example, if you use the upper 4 bits of pointers for flags, you should use, for 32-bit applications:

-pointer-mask=0x0fffffff

Note:

  • If you switch between 32-bit and 64-bit applications, you can use the options -pointer-mask-32 and -pointer-mask-64 to specify a pointer mask for each type of application.

 

-pointer-mask-32

0xffffffff
 

This option is a variation on -pointer-mask. When you are using Purify with both 32-bit and 64-bit applications, use this option to specify a pointer mask for your 32-bit applications.

 

-pointer-mask-64

0xffffffffffffffff

This option is a variation on -pointer-mask. When you are using Purify with both 32-bit and 64-bit applications, use this option to specify a pointer mask for your 64-bit applications.

 

-pointer-offset

0

Tells Purify the size of the extra memory allocated by a custom malloc wrapper.

If you use a malloc wrapper that allocates extra memory for bookkeeping purposes over and above the size requested and returns an adjusted pointer past the extra memory allocated, Purify might incorrectly report memory in use as potential leaks (PLKs). This option ensures that Purify does not report false PLKs.

 

-search-mmaps

no

Purify automatically sets this option to yes if you use ObjectStore (OSCC).

Tells Purify to search for heap pointers in memory obtained from mmap. Use this option when using an object-oriented database such as ObjectStore, where mmap'd databases anchor many blocks of memory that would otherwise be reported as leaks.

 

-search-thread-stacks

no

Set this option to yes only if you are using the new leaks button or the purify_new_leaks API function in a multi-threaded program. The option instructs Purify to search thread stacks, in addition to the main stack,  for pointers into the heap, and so prevents Purify from reporting all memory allocated in threads as leaked.

By default, Purify searches only the main stack for memory leaks. This is appropriate if you are having Purify report leaks only after your program has exited, and are not using the "new leaks" capability:

 

Notes: