Starting Memory Debugging in TotalView
On most architectures, there is little you need to do to prepare your program for memory debugging. In most cases, just compile your program using the
-g command-line option. In some cases, you may need to link your program with the TotalView’s Heap Interposition Agent (
HIA). (See
How TotalView Intercepts Memory Data and
Linking Your Application with the HIA for more information.)
NOTE: TotalView must be able to preload your program with its
HIA. In many cases, it does this automatically. However, it cannot preload the HIA for applications that run on IBM RS/6000 platforms. For more information, see
Linking Your Application with the HIA.
For more general information on preparing programs to debug memory issues, including platform-specific details, see
Preparing Programs for Memory Debugging.
To start debugging memory in TotalView:
1. Start TotalView and load a debugging session in the normal way.
2. Enable Memory Debugging, in these ways:
Before starting your program, check “Enable memory debugging” in the Debug Options section of the Session Editor.
From the Debug menu, check Enable Memory Debugging.
From the memory toolbar, by selecting the Enable memory debugging icon:
Whenever your program is stopped—which happens when you halt the program, when a memory problem occurs, or just before the program exits—TotalView can create a report that describes leaks.