PDA

View Full Version : Setting and Using Baselines



Josh-TotalView-Tech
07-20-2006, 09:46 AM
Debugging memory problems is an iterative process. First you see if you have problems and you try to figure out what the source of the problem is. You also need to evaluate how important the problem is. For example, it is usually a waste of time to look for a small memory leak unless you're convinced that whatever caused the leak will continue leaking memory until you've consumed it all. One of the better ways to see what is going on is to set a baseline using the Process Window's Process > Set Heap Baseline Command. [/url]
After setting this command, run your program, the use the [b]Process > Heap Change Summary to generate a summary of your program's memory changes.[br] http://www.etnus.com/Documentation/latest/html/TotalView_Tips/images/71Memory_HeapChangeSummary.png
[/url]
Buttons on this window let you obtain information on allocations made since you created the baseline and or leaks that have occurred.[br][br] http://www.etnus.com/Documentation/latest/html/TotalView_Tips/images/71Memory_HeapChangeSummary_leaks.png
[/url]
While there are many different ways you can use this information, one of the most common is to set a baseline right before a function executes, then use the Process Window's [b]Next command to step over it, then check to see what has happened. [/url]
If you need to more closely examine what has occurred, you can open the Memory Debugger and display a Leak Detection or Heap Status View. While these views normally show all information that the Memory Debugger has collected, each of these views has a [b]Relative to Baseline checkbox that limits the information being displayed to the allocations and leaks that occurred after you set the baseline.