Export (0) Print
Expand All

Environment.WorkingSet Property

Gets the amount of physical memory mapped to the process context.

[Visual Basic]
Public Shared ReadOnly Property WorkingSet As Long
[C#]
public static long WorkingSet {get;}
[C++]
public: __property static __int64 get_WorkingSet();
[JScript]
public static function get WorkingSet() : long;

Property Value

A 64-bit signed integer containing the number of bytes of physical memory mapped to the process context.

Remarks

Windows NT 4.0, Windows 2000 Platform Note:  This property behaves as described.

Windows 98, Windows Millennium Edition Platform Note:  This property always returns zero.

Example

[Visual Basic] 
' Sample for the Environment.WorkingSet property
Imports System

Class Sample
   Public Shared Sub Main()
      Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet)
   End Sub 'Main
End Class 'Sample
'
'This example produces the following results:
'
'WorkingSet: 5038080
'

[C#] 
// Sample for the Environment.WorkingSet property
using System;

class Sample 
{
    public static void Main() 
    {
    Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet);
    }
}
/*
This example produces the following results:

WorkingSet: 5038080
*/

[C++] 
// Sample for the Environment::WorkingSet property
#using <mscorlib.dll>

using namespace System;

int main() {
   Console::WriteLine(S"WorkingSet: {0}", __box(Environment::WorkingSet));
}
/*
This example produces the following results:

WorkingSet: 5038080
*/

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Environment Class | Environment Members | System Namespace

Show:
© 2014 Microsoft