Debugging with GDB Manual (5900-1473; WDB 6.2; January 2011)

Table Of Contents
$ set heap-check frame-count [num]
The stack depth, [num], is the number of stack frames that HP WDB collects for each
allocation.
You can specify a higher value for [num] to view more stack frames for each reported
allocation. However, the performance of the application is reduced because of the
increased stack depth.
14.10.8.2 Specifying minimum leak size
HP WDB enables you to specify the minimum leak size for stack trace collection to improve
the program's performance.
Stack trace collection slows down the program because it occurs on every allocation
call. Therefore, if the program is allocation-intensive, HP WDB can spend a substantial
amount of time collecting stack traces.
You can improve performance by using the command:
set heap-check min-leak-size num
For example, if you use,
set heap-check min-leak-size 100
HP WDB does not collect stack traces for allocations smaller than 100 bytes. HP WDB
still reports leaks smaller than this size, but does not include a stack trace.
14.10.8.3 Specifying minimum block size
The min-heap-size option reports the heap allocations that exceed the specified
number <num> of bytes based on the cumulative number of bytes that are allocated at
each call-site, which is inclusive of multiple calls to malloc at a particular call site. For
example:
set heap-check min-heap-size 100
When the option min-heap-size is set to 100, GDB reports all the cumulative block
allocations that 100 bytes at each call-site.
14.10.9 Scenarios in memory debugging
14.10.9.1 Stop when freeing unallocated or deallocated blocks
HP WDB enables you to locate improper calls to free() and realloc(), with the
command:
In interactive debugging mode: set heap-check free [on | off].
In batch mode debugging: check_free [on | off].
With this setting on, whenever the program calls free() or realloc() HP WDB
inspects the parameters to verify that they are pointing to valid currently allocated heap
blocks.
168 HP-UX Configuration-Specific Information