Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
Process Class
 MaxWorkingSet Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Process..::.MaxWorkingSet Property

Gets or sets the maximum allowable working set size for the associated process.

Namespace:  System.Diagnostics
Assembly:  System (in System.dll)
Visual Basic (Declaration)
Public Property MaxWorkingSet As IntPtr
Visual Basic (Usage)
Dim instance As Process
Dim value As IntPtr

value = instance.MaxWorkingSet

instance.MaxWorkingSet = value
C#
public IntPtr MaxWorkingSet { get; set; }
Visual C++
public:
property IntPtr MaxWorkingSet {
    IntPtr get ();
    void set (IntPtr value);
}
JScript
public function get MaxWorkingSet () : IntPtr
public function set MaxWorkingSet (value : IntPtr)

Property Value

Type: System..::.IntPtr
The maximum working set size that is allowed in memory for the process, in bytes.
ExceptionCondition
Win32Exception

Working set information cannot be retrieved from the associated process resource.

-or-

The process identifier or process handle is zero because the process has not been started.

NotSupportedException

You are trying to access the MaxWorkingSet property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer.

InvalidOperationException

The process Id is not available.

-or-

The process has exited.

PlatformNotSupportedException

The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property.

The working set of a process is the set of memory pages currently visible to the process in physical RAM memory. These pages are resident and available for an application to use without triggering a page fault.

The working set includes both shared and private data. The shared data includes the pages that contain all the instructions that your application executes, including the pages in your .dll files and the system.dll files. As the working set size increases, memory demand increases.

A process has minimum and maximum working set sizes. Each time a process resource is created, the system reserves an amount of memory equal to the minimum working set size for the process. The virtual memory manager attempts to keep at least the minimum amount of memory resident when the process is active, but it never keeps more than the maximum size.

The system sets the default working set sizes. You can modify these sizes using the MaxWorkingSet and MinWorkingSet members. However, setting these values does not guarantee that the memory will be reserved or resident.

NoteNote:

When you increase the working set size of a process, you take physical memory away from the rest of the system. Ensure that you do not request a minimum or maximum working set size that is too large, because doing so can degrade system performance.

  • LinkDemand 

    for full trust for the immediate caller. This member cannot be used by partially trusted code.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker