How to: Choose collection methods
Applies to: Visual Studio Visual Studio for Mac
Note
This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
The Visual Studio Profiling Tools support three methods of collecting performance data: sampling, instrumentation, and concurrency. You can also use either the sampling or instrumentation method to collect .NET memory allocation and lifetime data.
You can use the performance session Method property to specify the most appropriate collection method for your application. You can set the collection method from Performance Wizard, Performance Explorer, or from the property pages of a performance session. If you are using command-line tools, see Profiling from the Command-Line for more information.
Performance Wizard
To select a collection method using the Performance Wizard
- On the first page of the wizard, select one of the following options:
Option | Description |
---|---|
CPU Sampling | Collects application statistics that are useful for initial analysis and for analyzing CPU utilization issues. |
Instrumentation | Collects detailed timing data that are useful for focused analysis and for analyzing input/output performance issues. |
.NET Memory Allocation | Collects .NET Framework memory allocation data by using the sampling profiling method. |
Concurrency | Collects numeric resource contention data. |
Performance Explorer
To select a collection method using Performance Explorer
On the Performance Explorer toolbar, click the arrow next to the Method drop-down list.
Click the collection method that you prefer.
Performance Session Property Pages
To select the sampling or instrumentation method using performance session properties
In Performance Explorer, select the performance session.
A performance session file name has a .psess extension.
Right-click the performance session, and then click Properties.
In the Property Pages, click General.
Click the collection method that you prefer.
For information about the other options that are available when you are collecting sampling data, see Collecting Performance Statistics by Using Sampling
For information about the other options that are available when you are collecting sampling data, see Collecting Detailed Timing Data by Using Instrumentation.
To select .NET memory data collection by using performance session properties
In Performance Explorer, select the performance session.
A performance session file name has a .psess extension.
Right-click the performance session, and then click Properties.
In the Property Pages, click General.
Click Sampling or Instrumentation.
Click Collect .NET object allocation information to collect the size and number of .NET Framework object allocations.
(Optional) Click Also collect .NET object lifetime information to collect data about the garbage collection generations in which the object memory was reclaimed.
For information about the other options that are available when you are collecting .NET memory data, see Collect .NET memory allocation and lifetime data.
To select concurrency data collection by using performance session properties
In Performance Explorer, right-click the performance session, and then click Properties.
In the Property Pages, click General.
Click Concurrency.
See also
Configure performance sessions Understand sampling data values Performance session properties