Debugging with GDB (September 2007)
Chapter 14: HP-UX Configuration-Specific Information 135
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 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 be com e 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 rep ort 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 WDB memory leak checking.
info leaks
Displays a leak report, listing information such as the leaks, size of blocks, and
numb e r of instances.
info leaks filename
Writes the complete leak report output 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 WDB to stop the program whenever it tries to allocate a block larger
than num-bytes in size.