MemoryCache.PhysicalMemoryLimit 屬性

定義

取得快取可使用的實體記憶體百分比。Gets the percentage of physical memory that the cache can use.

public:
 property long PhysicalMemoryLimit { long get(); };
public long PhysicalMemoryLimit { get; }
member this.PhysicalMemoryLimit : int64
Public ReadOnly Property PhysicalMemoryLimit As Long

屬性值

快取可使用的實體記憶體百分比。The percentage of physical memory that the cache can use.

備註

PhysicalMemoryLimit 屬性會傳回 MemoryCache 類別的單一實例可以使用的實體電腦記憶體總計百分比。The PhysicalMemoryLimit property returns the percentage of total physical computer memory that can be used by a single instance of the MemoryCache class. 如果快取實例超過指定的限制,就會移除快取專案。If the cache instance exceeds the specified limit, cache entries are removed.

您可以在應用程式佈建檔中指定 PhysicalMemoryLimit 屬性的設定。The settings for the PhysicalMemoryLimit property can be specified in the application configuration file. 或者,當初始化 MemoryCache 類別時,呼叫端可以傳遞它們。Alternatively, they can be passed by a caller when the MemoryCache class is initialized. 如需如何設定此屬性的詳細資訊,請參閱<namedCaches> 元素(快取設定)For more information about how to configure this property, see <namedCaches> Element (Cache Settings). 如需如何在初始化 MemoryCache 類別時設定屬性的詳細資訊,請參閱 MemoryCache.MemoryCache(String, NameValueCollection) 方法。For more information about how to configure the property when the MemoryCache class is being initialized, see the MemoryCache.MemoryCache(String, NameValueCollection) method.

適用於

另請參閱