Debugging Memory Problems with MemoryScape : Chapter 2 Memory Tasks : Task 3: ­Setting MemoryScape Options : Basic Options

Basic Options
MemoryScape automatically displays the Memory Debugging Options screen after you add a program. You can also display it by selecting Memory Debugging Options on the primary navigation bar, Figure 40.
 
 
Controls on this page let you select four levels of debugging activity: Low, Medium, High, or Extreme.
Low
MemoryScape records all memory requests. These include calls to malloc(), realloc(), and other calls to your malloc library. It also includes calls to C++ operators such as new and delete that indirectly use this library. It can even include memory management functions performed by some Fortran libraries.
When you ask for a report, MemoryScape analyzes this recorded information and displays the information you request.
This selection also tells MemoryScape that it should notify you when events occur.
In most cases, Low is all you’ll ever need.
Medium
In addition to performing all operations indicated by Low, MemoryScape also writes guard blocks before and after allocated memory blocks. For more information on guard blocks and locating corrupted memory, see Task 11: “Viewing Corrupted Memory”.
Because MemoryScape is writing additional information, the size of the allocated memory block is slightly larger. Although this action alters your program’s memory usage, the extra overhead is very small.
Select Medium only when you need to check for corrupted memory.
High
In addition to performing all operations indicated by the Low level, MemoryScape will also write a Red Zone after the allocated memory block and notify you if you access memory in this Red Zone. This is called an overrun.
Because MemoryScape is allocating additional memory for the Red Zone, your program’s memory usage is affected, and the extra overhead can be significant.
Select High only if you need to check for memory overruns. As an alternative, you can select Low and use the Red Zones button on the task bar to turn on Red Zones as needed for suspect allocations.
To find underruns in your allocated memory, see “Use Red Zones to find memory access violations”.
Extreme
In addition to performing all operations indicated by the Low, Medium, and High levels, MemoryScape will paint allocated and deallocated memory as well as hoard memory.
As you might suspect, these activities both decrease performance and use more of your program’s memory. For information on when to use these features, see Task 15: “Hoarding Deallocated Memory” and Task 16: “Painting Memory”.
Select Extreme only if you need hoarding and painting.
Red Zone controls appear on the toolbar only on platforms that support Red Zone capabilities. See the Platform Guide for specific platform support. This applies to the High and Extreme levels only.
If you desire combinations of options other than those described above, see “Advanced Options”, which allow you to select individual memory debugging options a la carte, as well as change the default settings.

Rogue Wave Software, Inc.
Voice: (303) 473-9118
rwonlinedocs@roguewave.com