GC (VSPerfCmd)

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

The GC option enables the collection of .NET Framework memory allocation and object lifetime data. The GC option can only be used with the sampling profiling method and only with the Launch option.

When you are using the GC option, the VSPerfClrEnv /sampleon command is not required.

If no parameters are specified, or if the Allocation parameter is specified, only .NET Framework memory allocation data is collected. If the Lifetime parameter is specified, both .NET Framework memory allocation and .NET Framework object lifetime data is collected.

Syntax

VSPerfCmd.exe /Launch:AppName /GC[:{Allocation|Lifetime}] [Options]  

Parameters

Allocation
Default. Collects .NET Framework memory allocation data.

Lifetime
Collects both .NET Framework memory allocation data and .NET Framework object lifetime data.

Required Options

The GC option can only be used with the Launch option.

Launch: AppName
Starts the specified application and begins profiling with the sampling method.

Example

The following example launches an application and collects .NET Framework memory allocation data.

VSPerfCmd.exe /Launch:TestApp.exe /gc  

See Also

VSPerfCmd
Profiling Stand-Alone Applications
Profiling ASP.NET Web Applications
Profiling Services