Share via


MemoryCacheElement.PhysicalMemoryLimitPercentage 屬性

定義

取得或設定可供快取使用的伺服器記憶體百分比。

public:
 property int PhysicalMemoryLimitPercentage { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("physicalMemoryLimitPercentage", DefaultValue=0)]
[System.Configuration.IntegerValidator(MaxValue=100, MinValue=0)]
public int PhysicalMemoryLimitPercentage { get; set; }
[<System.Configuration.ConfigurationProperty("physicalMemoryLimitPercentage", DefaultValue=0)>]
[<System.Configuration.IntegerValidator(MaxValue=100, MinValue=0)>]
member this.PhysicalMemoryLimitPercentage : int with get, set
Public Property PhysicalMemoryLimitPercentage As Integer

屬性值

可供快取使用的實體記憶體百分比,以 1 到 100 之間的整數值表示。 預設值為零,表示 MemoryCache 執行個體會根據電腦上安裝的記憶體數量管理本身的記憶體。

屬性

備註

如果快取大小超過指定的限制,記憶體快取實作會移除快取專案。

您可以從應用程式組態檔中的組態屬性讀取physicalMemoryLimitPercentage屬性的設定PhysicalMemoryLimit。 或者,當類別初始化時 MemoryCache ,可以傳遞值。

如需如何設定快取的詳細資訊,請參閱 <namedCaches> 元素 (快取設定)

適用於

另請參閱