Starting Profiling Session from Visual Studio
The main usage scenario of dotMemory integrated in Visual Studio is profiling the currently developed application. For this purpose, in this mode, dotMemory offers some additional profiling capabilities. More specifically, it allows you to profile not just a particular project, but a particular 'run configuration'.
Run configurations give you an ability to create a number of predefined configurations with different run parameters for your startup project, an arbitrary executable, or even any static method*. For example, you can create a number of configurations that will differ by CPU architecture and CLR version. These configurations can be used to quickly run or debug your project without the need to set up particular run parameters each time. As dotMemory shares the ReSharper platform, it is able to profile any run configuration.
By default, your solution has only one run configuration - the configuration for the startup project.
In this section:
To start profiling of a startup project
In the Visual Studio menu, select Profile Startup Project window.
. This will open theIn the Profile Startup Project window, configure profiling settings as described in Configuring Profiling Session.
Click Run.
To start profiling of a specific run configuration
Create a run configuration for your project, executable, or particular static method. To do this, in the Visual Studio menu, select ReSharper documentation.
, select the corresponding item. This will open the window with run configuration options. For more details on them, refer to theSelect the created run configuration in the Build & Run tool window.
In the Build & Run tool window, click Start memory profiling....
Note that profiling of run configurations for static methods can be started using the action list of the particular static method.
To quickly start profiling of a static method
Open the action list for the method by placing cursor on the method and pressing Alt+Enter.
In the list, select
.
If you want to profile an arbitrary application from Visual Studio (rather than a particular run configuration), you have such a capability. In this case, starting a profiling session looks almost the same as in dotMemory Standalone.
To start profiling of an application
In the Visual Studio menu, select Profile Application window.
. This will open theIn the left panel of the Profile Application window, select the type of application you are going to profile.
In the right panel, configure profiling settings as described in Configuring Profiling Session.
Click Run.
To start profiling of an already running process
In the Visual Studio menu, select Profile Application window.
. This will open the- In the left panel of the Profile Application window in Attach to Process, select the .NET process you are going to profile. Only processes running on .NET Framework 4.0 or higher are displayed and available to attach.
If a process you are looking for is missing, click Refresh to update the list of processes and/or click Show All Processes to grant dotMemory administrative permissions (this will show more processes running in the system). In the right panel, configure profiling settings as described in Configuring Profiling Session.
Click Run.