Gets or sets the maximum allowable working set for the associated process.
[Visual Basic] Public Property MaxWorkingSet As Integer [C#] public int MaxWorkingSet {get; set;} [C++] public: __property int get_MaxWorkingSet(); public: __property void set_MaxWorkingSet(int); [JScript] public function get MaxWorkingSet() : int; public function set MaxWorkingSet(int);
The maximum working set size allowed in memory for the process.
Exception Type | Condition |
---|---|
Win32Exception | Working set information could not be retrieved from the associated process resource.
-or- The process ID or process handle is 0. (The process has not been started.) |
SystemException | You are attempting to access the MaxWorkingSet on a remote computer. The property is only available for processes running on the local computer.
-or- The process Id is not available. -or- The process has exited. |
The working set of a program 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.
A process has an associated minimum working set size and maximum working set size. Each time a process resource is created, it reserves the minimum working set size for the process. The virtual memory manager attempts to keep enough memory for the minimum working set resident when the process is active, but keeps no more than the maximum size.
Note By "process" here, we mean the associated process resource, not an instance of the Process class.
The system sets the default working set sizes. You can modify the working set sizes using the MaxWorkingSet and MinWorkingSet members. Setting these values is not a guarantee that the memory will be reserved or resident.
CAUTION Be careful about requesting too large a minimum or maximum working set size, because doing so can degrade system performance.
Process Class | Process Members | System.Diagnostics Namespace | MinWorkingSet