MemoryCacheElement.PhysicalMemoryLimitPercentage Property


Gets or sets the percentage of server memory that can be used by the cache.

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

Property Value

The percentage of physical memory that the cache can use, expressed as an integer value from 1 to 100. The default is zero, which indicates that MemoryCache instances manage their own memory based on the amount of memory that is installed on the computer.



If the cache size exceeds the specified limit, the memory cache implementation removes cache entries.

The setting for the PhysicalMemoryLimit property can be read from physicalMemoryLimitPercentage configuration attribute in the application configuration file. Alternatively, the value can be passed when the MemoryCache class is initialized.

For more information about how to configure the cache, see <namedCaches> Element (Cache Settings).

Applies to

See also