View Full Version : How can I visualizing the Heap?

07-20-2006, 08:57 AM
The Memory Debugger can provide a visual depiction of the heap.

[/url]You create this view in the same way as any other: [/url]Select [b]Tools > Memory Debugging. [/url]Select Enable Memory Debugging with the Configuration Tab. [/url]Select the Heap Status Tab. [/url]If you want leaks to be displayed, press the ... button next to the Graphical View pulldown. [/url]In the Preferences Window, select Label leaked memory blocks. If you are debugging a C++ program, you probably also want to select Check interior pointers during leak detection. [/url]After pressing OK, let your program run until a breakpoint. [/url]Press the Generate View button. The top area displays bars indicating allocated memory blocks. The block's coloring indicates the block's status. You can change the scale of what is displayed using the magnifying glass icons just above and to the right of the blocks.
[/url]When you select a block in the top area, the Memory Debugger looks up information on the block and displays information in the bottom area. While the block you selected is highlighted, the Memory Debugger also highlights other blocks created by code that had the same backtrace.[br]
[/url]The bottom area can display information in two ways: [/url][b]Heap Information: the center pane displays information on the block that you selected, and the right pane displays information about all blocks that were created that have the same backtrace. [/url]Backtrace/Source: Contains two panes that display the backtrace that existed when the block was allocated and the line that caused the allocation to occur. [/url]If you right-click your mouse
on a block in the top portion, the Memory Debugger displays a menu
containing a Properties command. If you select this command, the Memory
Debugger both displays its Block Properties window, which contains more
information about the block, and begins tracking this block for you.