This section lists the options you can use when you run .NET managed programs from the command line.
Command-line option conventions:
§ If a yes or no option is specified and a value is not explicitly given, Purify assumes the value to be yes.
§ Most options have equivalents in Purify dialog boxes, or can be specified in Additional options in the Files tab in the settings dialog boxes. Options that can be set only in the command line are indicated in the list below with an asterisk (*).
§ Options you specify in the command line override any settings that were saved from the Purify user interface, but they apply only for the current run of the program.
§ For command-line option syntax, click
/MemprofGenerateReferenceGraph *
/MemprofTrackExcludedClassObjects
/Net *
/PurifyDefaultInstrumentationType
/Usage *
/Version *
/? *
/ClassInstrumentationType=all | selective
Specifies whether to include or exclude specific .NET classes at runtime. Use this option together with the /PurifyClassesIncludeMust or /PurifyClassesExcludeMust option.
Purify instruments and collects memory profiling data for classes as follows:
all |
Directs Purify to exclude .NET classes matching any pattern specified in /PurifyClassesExcludeMust. All other classes will be included. |
selective |
Directs Purify to include .NET classes matching any pattern specified in /PurifyClassesIncludeMust. All other classes will be excluded.. |
For example:
purify /PurifyClassesExcludeMust=myClass.*;*.myInnerClass.* /ClassInstrumentationType=all /SaveData /net MyApp.exe arg1
Purify instruments and collects data for all classes except classes whose fully qualified name begins with the string myClass., or has the string .myInnerClass. embedded in it.
Command line only option.
/ExeIniFileName=<filename>
Specifies the name of an INI file containing runtime options and settings you want Purify to use for the program run. For example:
purify /SaveTextData /ExeIniFileName=myapp_options.ini /net MyApp.exe arg1
Purify profiles MyApp.exe using the runtime options and settings contained in myapp_options.ini, and saves the analysis data to a text file.
Command line only option.
/FilterFiles=<filename1.mft;filename2.mft;filename3.mft...>
Specifies the Purify memory profiling filter files (.mft) you want Purify to use to filter data from the resulting analysis dataset that it saves to a text file. To specify multiple files, separate them with semicolons. For example:
purify /SaveTextData /FilterFiles=MyViewer_exe.mft;C:\testapp\MyViewer_exe.mft /net MyApp.exe
Purify profiles MyApp.exe and uses the filter files MyViewer_exe.mft and c:\testapp\MyViewer_exe.mft to filter the analysis data before saving it to a text file.
Command line only option.
/MemprofGenerateReferenceGraph=yes|no
Specifies that you want Purify to collect detailed object data for presentation in the Object Detail window. For example:
purify /MemprofGenerateReferenceGraph=yes /net MyApp.exe
Command line only option.
/MemprofTrackExcludedClassObjects=yes | no
When you selectively instrument classes, specifies whether you want Purify to identify objects allocated by classes that were excluded from data collection. For example:
purify /MemprofTrackExcludedClassObjects=yes /PurifyClassesExcludeMust=myClass.*;*.myInnerClass.* /ClassInstrumentationType=all /net MyApp.exe
Purify assigns a root type of "excluded" to objects created by excluded classes.
You can specify this option in the command line, or in Additional options in the Files tab in the settings dialog boxes.
/Net
Specifies that the program you want to profile is a .NET managed code program.
Command line only option.
/PrintInstallDir
Displays the directory where you installed Purify.
Command line only option.
/PurifyClassesExcludeMust=<string1;string2;string3...>
Selects .NET classes to exclude from memory profiling. Purify collects memory profiling data for all classes except classes whose fully qualified name contains a character string that matches a value in the argument list.
To use /PurifyClassesExcludeMust, you must also specify /ClassInstrumentationType=all. For example:
purify /PurifyClassesExcludeMust=myClass.*;*.myInnerClass.* /ClassInstrumentationType=all /SaveData /net MyApp.exe
Pattern string matching is case-sensitive.
Use an asterisk (*) to denote any character string; use a backslash (\) with the asterisk if the name itself contains an asterisk. For example:
This pattern |
Matches any class whose name |
Foo* |
Begins with Foo and is followed by any string |
*chr |
Starts with any string and ends in chr |
*font* |
Contains font |
delete(void\** |
Is delete and whose first argument is void* |
/PurifyClassesIncludeMust=<string1;string2;string3...>
Selects .NET classes to profile. Purify collects memory profiling data for only those classes whose fully qualified name contains a character string that matches a value in the argument list. All other classes are excluded.
To use /PurifyClassesIncludeMust, you must also specify /ClassInstrumentationType=selective. For example:
purify /PurifyClassesIncludeMust=myClass.*;*.myInnerClass.* /ClassInstrumentationType=selective /SaveData /net MyApp.exe
Pattern string matching is case-sensitive.
Use an asterisk (*) to denote any character string; use a backslash (\) with the asterisk if the name itself contains an asterisk. For example:
This pattern |
Matches any class whose name |
Foo* |
Begins with Foo and is followed by any string |
*chr |
Starts with any string and ends in chr |
*font* |
Contains font |
delete(void\** |
Is delete and whose first argument is void* |
/PurifyDefaultInstrumentationType=line | function
Specifies the level at which you want Purify to collect memory profiling data. For example:
purify /PurifyDefaultInstrumentationType=function /SaveData /net MyApp.exe arg1
By default, Purify uses line for all programs with debug data.
/SaveData[=<pmyname.pmy>]
Runs a program and saves the data to a Purify memory profiling data file (.pmy) without opening the user interface. For example:
purify /SaveData=myapp1.pmy /net myDotNetApp.exe
If you don't specify a filename for the data, Purify uses <ProgramName>.pmy. In the examples above, the filename would have defaulted to myDotNetApp.pmy.
Command line only option.
/SaveTextData[=<txtname.txt>]
Runs a program and saves the data to an ASCII text file (.txt) without opening the user interface. For example:
purify /SaveTextData=myapp1.txt /net myDotNetApp.exe
If you don't specify a filename for the data, Purify uses <ProgramName>.txt. In the examples above, the filename would have defaulted to myDotNetApp.txt.
Command line only option.
/Usage
Displays the syntax for command-line options.
Command line only option.
/Version
Displays version information about the current Purify installation.
Command line only option.
/?
Displays the syntax for command-line options.
Command line only option.
filename.pmy
Displays a previously saved Purify memory profiling data file. You must enter the option for each file you want to open. For example:
purify myapp.pmy
Command line only option.
Syntax Notes:
§ Any Purify options you specify must precede the name of your program. Purify interprets anything after the name of your program as an argument passed to the program.
§ You must place quotation marks around strings with embedded spaces. For example: /SaveData="C:\Program Files\myTests\LeakTest.pmy"
§ You must precede option names with a slash (/) or hyphen (-), and use an equal sign (=) to specify an option value.
§ Command-line options in the Help are always shown in mixed case. However, Purify ignores the case and any hyphens or underscores in the option name. For example, the option /leaks-at-exit is equivalent to /LEAKS_AT_EXIT and -LeaksAtExit.
(C) Copyright IBM Corporation 1992, 2010.