Process.MaxWorkingSet 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置关联进程允许的最大工作集大小(以字节为单位)。
public:
property IntPtr MaxWorkingSet { IntPtr get(); void set(IntPtr value); };
public IntPtr MaxWorkingSet { [System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")] [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] get; [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] [System.Runtime.Versioning.SupportedOSPlatform("macos")] [System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")] [System.Runtime.Versioning.SupportedOSPlatform("windows")] set; }
public IntPtr MaxWorkingSet { get; [System.Runtime.Versioning.SupportedOSPlatform("windows")] set; }
public IntPtr MaxWorkingSet { [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] get; [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] [System.Runtime.Versioning.SupportedOSPlatform("macos")] [System.Runtime.Versioning.SupportedOSPlatform("windows")] set; }
public IntPtr MaxWorkingSet { get; set; }
[<get: System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("freebsd")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("macos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.MaxWorkingSet : nativeint with get, set
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.MaxWorkingSet : nativeint with get, set
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("freebsd")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("macos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.MaxWorkingSet : nativeint with get, set
member this.MaxWorkingSet : nativeint with get, set
Public Property MaxWorkingSet As IntPtr
属性值
nativeint
进程内存中允许的最大工作集大小(以字节为单位)。
- 属性
例外
最大工作集大小无效。 它必须大于或等于最小工作集大小。
你正在尝试访问 MaxWorkingSet 远程计算机上运行的进程的属性。 此属性仅适用于在本地计算机上运行的进程。
注解
进程的工作集是物理 RAM 内存中的进程当前可见的内存页的集合。 这些页是常驻的,可供应用程序使用,而不会触发页面错误。
工作集包括共享数据和专用数据。 共享数据包括包含应用程序执行的所有说明的页面,包括 .dll 文件和 system.dll 文件中的页面。 随着工作集大小的增加,内存需求增加。
进程具有最小和最大工作集大小。 每次创建进程资源时,系统都会保留等于进程最小工作集大小的内存量。 虚拟内存管理器尝试在进程处于活动状态时至少保留最小内存量,但它永远不会保留超过最大大小。
系统设置默认的工作集大小。 可以使用和MaxWorkingSet成员修改这些大小MinWorkingSet。 但是,设置这些值不能保证内存将保留或驻留。
注释
增加进程的工作集大小时,会将物理内存从系统的其余部分带走。 确保不请求太大的最小或最大工作集大小,因为这样做会降低系统性能。