Command Line Arguments

There are two executable files that can be used to start .NET Memory Profiler from the command prompt: NetMemProfiler.exe and NetMemProfilerConsole.exe. Both of these are located in the installation directory of .NET Memory Profiler.

By providing command line arguments to the executables, session files can be opened, or profiler settings can be modified and a new session started.

The command line should be written in the following form:

NetMemProfiler[Console].exe [options] [<executable to profile>] [<arguments for the profiled process>]

The options are used to change the profiler settings, to specify a session file to open, and to specify the process to profile.

If no process to profile or session to open has been specified by the options, then the first non-option argument is used as a path to an executable to profile. For example, the command

NetMemProfiler.exe MemUser.exe

will start profiling the executable MemUser.exe using the standard settings (defined using the Settings form) .

To modify the settings, it is possible to provide additional arguments. For example

NetMemProfiler.exe /dc+ MemUser.exe

will start profiling the executable MemUser.exe with delayed clean up enabled (specified by the /dc+ option). If a setting conflicts with one of the standard settings, the standard setting will be disabled. For instance, delayed clean up cannot be used together with real-time data collection. If real-time collection were enabled in the standard settings, it would be disabled automatically.

It is not allowed to specify conflicting options on the command line, e.g., /dc+ (enable delayed clean up) and /cr+ (enable real-time data collection) cannot be used at the same time.

The options may be specified using either a slash, ‘/’, or single dash, ‘-.‘ It is not allowed to have extra spaces between a ‘/’ or ‘–‘ and the name of the option.

Some options take an additional value. The value can be a boolean, an integer, or a string.

Boolean values are specified using the symbol ‘0’ or ‘-‘ for false, and ‘1’ or ‘+’ for true. If no value is supplied, then the value is set to true.

Integer values and boolean values can be provided directly after the argument, or they can be separated by a ‘:’ or a space.

String values must be separated by a ‘:’ or a space.

NOTE! The settings that are modified by the command line options only affect the profiling session that is initialized by the command line arguments. If that session is stopped and another one is started, the settings from the standard profiler Settings form are used. Consequently, it is not allowed to specify options that modify settings without also specifying a process to profile.