Debugging Dynamic Memory Usage Errors Using HP WDB v6.3 (5900-2181, August 2012)

1. Load the program to HP WDB GUI.
2. Stop the program execution at the required breakpoints.
3. Select View->Memory Usage->Heap Arena to view the arena information. The arena information
is displayed in the View Heap Arena window.
The following information is displayed in the View Heap Arena window:
Arenas
The Arena IDs are listed in the Arenas list menu. Select the required Arena ID from the Arenas
list menu to view Arena ID Summary, or Block Details for the selected arena.
Arena ID Summary
The summary information for the selected Arena ID is displayed in the Arena ID Summary
frame.
Block Details
To view the block level details in an arena, select Block Details after selecting the required
Arena ID in the Arenas list menu. The block distribution in the arena is displayed in the Arenas
Block Distribution window.
The Arenas Block Distribution window displays the block level space distribution graph for an
arena. The graph displays the space occupied by the user blocks, the free blocks, the unclaimed
space, and the malloc metadata (which includes the node blocks, the cached blocks, the
holding header blocks, and the holding SBA blocks). The virtual address of the blocks is used
to arrange the blocks in the graph. The Block ID of the block is also displayed within the block
if the scale of the graph supports the display. The start of the heap, the end of the heap, the
total heap size, and the total number of blocks are also listed.
WDB GUI displays the block distribution graph in the default window. If the complete block
distribution graph cannot be displayed in the default window, you must select the Expand
Block Distribution Graph toggle option to view the magnified block distribution graph.
To view the Block ID, the block type, the block size, and the virtual address for each block in
the arena, you must click on the required block in the block distribution graph. The number
of used blocks in each block-count range is also displayed graphically for the selected arena.
This information is also displayed in a tabular format.
Heap Arena Space Usage
The Heap Arena Space Usage frame displays the Arena ID, the space usage (in KB) in the
arena, and the percentage space usage in each arena in comparison to the total space
occupied by all the arenas. The comparative space usage across arenas is also displayed in
a pie chart. The Arena ID is also displayed in the pie chart if the scale of the graph supports
it.
Full Summary
To view the summary for all the arenas, click Full Summary. The summary information for all
the arenas is displayed in the Arena Summary window.
Heap Arena Detailed Graphs
The Heap Arena Detailed Graphs display the following information:
The byte distribution (in KB) across the used ordinary blocks, the used small blocks, the free
ordinary blocks, and the free small blocks is displayed for each arena. This information is
displayed as a bar graph for each arena.
The byte distribution for the used ordinary blocks, the used small blocks, the free ordinary
blocks, and the free small blocks across the arenas is displayed in a pie chart. This information
is also displayed in a table.
66