Debugging Dynamic Memory Usage Errors Using HP WDB

List of Examples
1 Filtered Heap Reporting for Allocations Exceeding <num> at a Particular Call-Site.............................19
2 Incremental Heap Profile........................................................................................................................21
3 Monitoring memory usage in an arena...................................................................................................26
4 Simulating out-of-memory conditions after <N> allocations .................................................................31
5 Simulating out-of-memory conditions after <N> bytes are allocated.....................................................33
6 Simulating out-of-memory conditions after a random number of allocations.......................................35
7 Monitoring a specific address.................................................................................................................38
8 Monitoring allocations greater than a specified size...............................................................................40
9 Monitoring program heap growth..........................................................................................................42
10 High Water-Mark Feature.....................................................................................................................44
11 Monitoring heap-corruption caused by erroneous handling of string functions.................................47
12 Bounds-checking to detect out-of-bounds writes..................................................................................49
13 Detecting heap corruption using the info corruption command .........................................................52
14 Scrambling a memory block on de-allocation.......................................................................................54
15 Batch Mode Debugging for a 32-bit Application running on Itanium.................................................61
16 Detecting a double free error.................................................................................................................67
17 Detecting de-allocation of memory that has not been initialized.........................................................68
18 Detecting de-allocation of un-allocated blocks.....................................................................................69
19 Detecting memory leaks that are caused when an application overwrites a pointer that currently
addresses a block of memory with another address or data.....................................................................70
20 Detecting memory leaks that are caused when a pointer variable in an application addresses memory
that is out of the scope of the application..................................................................................................71
21 Detecting memory leaks when you free a structure or an array that has pointers which are not
freed............................................................................................................................................................72
9