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

(gdb) file testincremental
Reading symbols from testincremental.. done.
(gdb) set heap-check interval 1
(gdb) set heap-check repeat 2
(gdb) b marker1
Breakpoint 1 at 0x4000000000000e50:0: file testincremental.c,
line 9 from testincremental
(gdb) r
Starting program: testincremental
Breakpoint 1, marker1 () at testincremental.c:9 {}
(gdb) info heap-interval
Analyzing heap ...
==========================================================
Start Time: Mon Oct 30 01:38:11 2006
End Time: Mon Oct 30 01:38:12 2006
Interval: 1
40 bytes allocated in 4 blocks
No. Total bytes Blocks Address Function
0 40 4 0x6000000000004840 func1()
(gdb) c
Continuing.
Breakpoint 1, marker1 () at /testincremental.c:99 {}
(gdb) info heap-interval
Analyzing heap ...
==========================================================
Start Time: Mon Oct 30 01:38:11 2006
End Time: Mon Oct 30 01:38:12 2006
Interval: 1
40 bytes allocated in 4 blocks
No. Total bytes Blocks Address Function
0 40 4 0x6000000000004840 func1()
===========================================================
Start Time: Mon Oct 30 01:38:13 2006
End Time: Mon Oct 30 01:38:14 2006
Interval: 2
40 bytes allocated in 4 blocks
No. Total bytes Blocks Address Function
0 40 4 0x60000000000048c0 func1()
===========================================================
NOTE: WDB-GUI provides graphical representation of the Incremental Heap Profile.
For more information see “Incremental Heap Profiling Using WDB GUI” (page 79).
Arena Profile
WDB enables you to view the high-level memory-usage statistics of a running application.
You can analyze the memory-usage statistics to understand the memory consumption,
the allocation pattern, and the heap-fragmentation of the application.
20