The Working Set Analyzer is a WPF performance analysis tool that provides information on the memory usage of a specified process. This tool allows you to generate a snapshot of application memory usage information at a particular application state.
Working Set of an Application
The working set of an application is a collection of those pages in its virtual address space that have been recently referenced. It includes both shared and private data. The shared data includes pages that contain all instructions your application executes, including those in your DLLs and the system DLLs. As the working set size increases, memory demand increases. For more information on the working set, see Process Working Set.
Virtual Address Dump (VaDump) Utility
Virtual Address Dump (VaDump) creates a listing that contains information about the memory usage of a specified process. This tool is located in the following directory:
~\Program Files\Microsoft Visual Studio 8\Common7\Tools\Bin\winnt
Important Note: |
|---|
| You must ensure that the system execution path includes the directory location of VaDump. Otherwise, Working Set Analyzer will not function correctly. |
Using Working Set Analyzer
To use Working Set Analyzer, start the WPF application you want to profile. After you have started Working Set Analyzer, choose the Select Process option:
Working Set Analyzer Select Process Dialog Box
Select the process whose working set you want to analyze; then, click the Capture button. The Working Set Analyzer first invokes VaDump to generate memory usage information. Next, it parses the information and presents it in a graphically-rich format.
Note: |
|---|
| The working set data represents a static view of memory usage. You may want to generate several sets of working set data at different points in your application, and compare the differences in memory usage. |
When the working set data is ready to view, Working Set Analyzer generates a tree view that represents the dynamic data, system data, and application modules.
Working Set Analyzer memory usage categories
For WPF applications, the WPF Modules category contains modules that are system-specific to WPF. Click the category you want to display and a set of pie charts displays. For example, clicking the WPF Modules category displays the following information on the left side of the window.
Working Set Analyzer memory usage pie chart for WPF Modules
The caption at the top displays the total size of the working set category. In this case, WPF Modules represents 9160KB of memory usage. This pie chart represents the individual memory usage of all modules that define the WPF Modules category.
Note: |
|---|
| The size of a memory usage category reflects the memory usage of your application at the moment the working set information was captured. |
The small table represents the memory usage of shared, sharable, and private bytes.
Working Set Analyzer memory usage table
The shared bytes category represents the amount of memory that could be potentially shared by other WPF applications.
Viewing Application Memory Usage
To view the memory usage for your application, select the name of the executable file from the Other Modules category in the Working Set tree view.
Working Set Analyzer memory usage categories
Saving and Reloading Working Set Analyzer Files
To save the current working set usage information, select File from the main menu of Working Set Analyzer. Then, click the Save VADump output button. Once you have saved the working set usage information, you can generate another snapshot of memory usage by clicking the Capture button. To reload a file containing VADump content, select File from the main menu of Working Set Analyzer. Then, click the Open VADump output button.
Using a Timer Delay to Capture Working Set Information
The Working Set Analyzer provides a time delay feature that allows you to capture working set usage information after a specified interval of time. Select Actions from the main menu of Working Set Analyzer. Then, click the Launch Process… button.
Specify the application you want to run, using the Browse button if needed. Next, enter any arguments for the application. Finally, enter the number of seconds you want to delay the capture of memory usage information. Then, click the Launch button. The status text at the bottom of the Working Set Analyzer counts down the number of remaining seconds until capture, which allows you time to modify your application's state. Once the capture is complete, the status text displays "Done".