Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)

set heap-check [on|off] This toggles the capability for detection of leaks, heap
profiles, bounds checking, and checking for double free.
info heap Displays a heap report, listing information such as the start
of heap, end of heap, heap size, heap allocations, size of
blocks, and number of instances. The report shows heap
usage at the point you use the info heap command. The
report does not show allocations that have already been
freed. For example, if you make several allocations, free
them all, and then you use info heap, the result does not
show any allocations.
info heap filename Writes the complete report output containing the heap
summary as well as the details to the specified file.
info heap idnumber Produces detailed information on the specified heap
allocation including the allocation call stack.
show heap-check Displays all current settings for memory checking.
set heap-check interval <
nn >
This command starts incremental heap growth profile. All
allocations prior to the execution of this command are
ignored from report. If incremental heap growth profile is
already on, executing this command will reset the counters
and start a fresh collection. Interval is specified in seconds.
set heap-check repeat < nn
>
This allows user to specify the number of intervals GDB
should collect the incremental heap growth. The default
value is 100. Every repeat of the interval tracks heap
allocation during that interval.
Example:
< gdb > set heap-check interval 10
< gdb > set heap-check repeat 100
Here HP WDB will create 100 incremental apart heap
profiles which are 10 seconds apart.
set heap-check reset GDB stores incremental heap growth data in an internal
file. During one session data is appended to this file. If the
session is very long, it is possible that this file may become
very large. This command discards the data existing in the
file and creates a new data file. Once this command is
executed, the user cannot see the old data.
info heap-interval < file
name >
This command creates the report of heap growth. The data
for each interval has the start and end time of the interval.
If file name is mentioned a detailed report is written in the
file.
set heap-check leaks [on |
off]
Controls HP WDB memory leak checking.
info leaks Displays a leak report, listing information such as the leaks,
size of blocks, and number of instances.
info leaks filename Writes the complete report output containing the leak
summary as well as the details to the specified file.
info leak leaknumber Produces detailed information on the specified leak including
the allocation call stack.
set heap-check block-size
num-bytes
Instructs HP WDB to stop the program whenever it tries to
allocate a block larger than num-bytes in size.
114 HP-UX Configuration-Specific Information