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 实例会基于计算机上安装的内存量来管理自己的内存。

属性

注解

如果缓存大小超过指定的限制,则内存缓存实现将删除缓存条目。

PhysicalMemoryLimit可以从应用程序配置文件中的配置属性读取physicalMemoryLimitPercentage属性的设置。 或者,可以在初始化 类时 MemoryCache 传递值。

有关如何配置缓存的详细信息,请参阅 <namedCaches> 元素 (缓存设置)

适用于

另请参阅