Debugging Dynamic Memory Usage Errors Using HP WDB (5900-1474; WDB 6.2; January 2011)

-------------------------------------------------------------------------
File Name : <stdout>
File Descriptor : 1
File Type : Character device
-------------------------------------------------------------------------
File Name : <stderr>
File Descriptor : 2
File Type : Character device
-------------------------------------------------------------------------
File Name : /tmp/textfile
File Descriptor : 4
File Type : Regular type
Stack-trace :-
#0 func()() at do_fopen.c:23
#1 main() at do_fopen.c:10
#2 main_opd_entry() from /usr/lib/hpux32/dld.so
The report as illustrated in the example above provides the summary and details of the
open files separately. The summary first shows the total number of files that were open
when the application exited. The first three entries are for standard input, output, and
error, so they can be ignored. However the fourth entry shows that a regular type file
with name /tmp/textfile was still open when the application exited. As you can see
in the code, the file /tmp/textfile was also opened with file-descriptor “3”, but since
it was closed before the exit of application, it is not reported. The detailed report provides
the stack-trace information at the point when the application opened the file. For
convenience, the pattern of the report is kept similar to that of the existing leak and heap
reports.
Settings to Manage Performance Degradation
Memory-debugging slows down the performance of an application by 20-40% because
of stack unwinding. Reducing the number of stack frames the debugger collects for each
allocation reduces the performance degradation.
Table 13 lists the options for reducing the performance degradation.
58