Process.MaxWorkingSet 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定關聯的處理序所允許的工作集大小上限,以位元組為單位。
public:
property IntPtr MaxWorkingSet { IntPtr get(); void set(IntPtr value); };
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("windows")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] [System.Runtime.Versioning.SupportedOSPlatform("macos")] set; }
public IntPtr MaxWorkingSet { [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] [System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")] get; [System.Runtime.Versioning.SupportedOSPlatform("windows")] [System.Runtime.Versioning.SupportedOSPlatform("freebsd")] [System.Runtime.Versioning.SupportedOSPlatform("macos")] [System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")] set; }
public IntPtr MaxWorkingSet { get; set; }
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
member this.MaxWorkingSet : nativeint with get, set
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("freebsd")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("macos")>]
member this.MaxWorkingSet : nativeint with get, set
[<set: System.Runtime.Versioning.SupportedOSPlatform("windows")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<get: System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("freebsd")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("macos")>]
[<get: System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
[<set: System.Runtime.Versioning.SupportedOSPlatform("maccatalyst")>]
member this.MaxWorkingSet : nativeint with get, set
member this.MaxWorkingSet : nativeint with get, set
Public Property MaxWorkingSet As IntPtr
屬性值
IntPtr
nativeint
處理序所需記憶體中工作集大小的最大值,以位元組 (Byte) 為單位。
- 屬性
例外狀況
工作集大小上限無效。 必須大於或等於工作集大小下限。
您正在嘗試存取於遠端電腦上執行之處理序的 MaxWorkingSet 屬性。 這個屬性僅供在本機電腦執行的處理序使用。
備註
程序的工作集是實體 RAM 記憶體中程序目前可見的記憶體分頁集。 這些頁面是常駐的,可供應用程式使用,而不會觸發分頁錯誤。
工作集包含共用和私人數據。 共用資料包含包含應用程式執行之所有指示的頁面,包括您 .dll 檔案中的頁面和 system.dll 檔案。 當工作集大小增加時,記憶體需求會增加。
進程具有最小和最大工作集大小。 每次建立進程資源時,系統會保留等於進程工作集大小下限的記憶體數量。 虛擬記憶體管理員會嘗試在進程處於作用中狀態時,至少保留最少的記憶體數量,但永遠不會保留超過大小上限。
系統會設定預設的工作集大小。 您可以使用和 MinWorkingSet 成員來修改這些大小MaxWorkingSet。 不過,設定這些值並不保證記憶體會保留或駐留。
注意
當您增加進程的工作集大小時,會將物理記憶體從系統的其餘部分中移除。 請確定您未要求太大的最小或最大工作集大小,因為這樣做可能會降低系統效能。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應