Edit

Share via


MemoryCacheElement.PhysicalMemoryLimitPercentage Property

Definition

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

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

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.

Attributes

Remarks

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