Debugging Memory Problems with MemoryScape™ : Chapter 2 Memory Tasks : Task 1: Getting Started : Starting MemoryScape
Starting MemoryScape
There are five different ways to start debugging memory:
1. Display the MemoryScape window by typing:
memscape
After MemoryScape displays its opening screen, you can begin adding programs and files to your memory debugging session. If you are running MemoryScape on a Macintosh, you can double-click on the program icon. Figure 33shows starting MemoryScape from a shell window and parts of screens you’ll use before you actually start debugging memory.
For additional information, see Adding Programs and Files to MemoryScape.
2. Directly invoke MemoryScape upon a file by typing:
memscape program_name
MemoryScape responds by displaying its Home | Summary screen. You can now use the run control to start your program. (Figure 34.)
 
If your program needs command-line options, you can add them by right-clicking on the program’s name and selecting Properties, Figure 32.
 
Figure 32: Properties Dialog Box
 
Figure 33: Starting MemoryScape
If you change these arguments after program execution starts, restart your program for the changes to take effect.
3. Directly invoke MemoryScape, adding needed program arguments.
memscape program_name -a arguments
Type all your program’s arguments after the -a. The next time you invoke MemoryScape on your program, these arguments will automatically be used.
MemoryScape displays its Home | Summary screen. (Figure 34.) Information on changing these options is discussed in the previous bullet.
4. Directly invoke MemoryScape, adding needed command-line options. Here are two skeletons on starting MemoryScape:
memscape [ program_name [ memoryscape_options ] [ -a arguments ] ]
memscape
memoryscape_options
MemoryScape options are typed either first or second, depending on if you are also naming a file. In all cases, arguments to your program must be the last arguments on the command line.
For more on options, see Chapter 6, "MemoryScape Command-Line Options".
5. Invoke MemoryScape in batch mode, as follows:
memscript options
For more on batch mode, see Chapter 5, "MemoryScape Scripting".
Before you begin program execution, you may want to configure MemoryScape for the different kinds of activities that it can perform. For more information, see Task 3: "­Setting MemoryScape Options". In most cases, the default options will meet your needs.
MemoryScape can provide memory information about a process only when the process is stopped. Therefore, when you ask for a report, MemoryScape stops execution. MemoryScape also stops execution when you ask for memory usage information. However, it quickly restarts execution after it collects usage information.
You will probably use the commands on the Home | Summary screens to stop and restart execution. The graph here either starts MemoryScape or adds more programs, Figure 34.
 
Figure 34: MemoryScape Home Page