MemoryCacheElement::PhysicalMemoryLimitPercentage Property
Gets or sets the percentage of server memory that can be used by the cache.
Assembly: System.Runtime.Caching (in System.Runtime.Caching.dll)
public: [ConfigurationPropertyAttribute("physicalMemoryLimitPercentage", DefaultValue = 0)] [IntegerValidatorAttribute(MinValue = 0, MaxValue = 100)] property int PhysicalMemoryLimitPercentage { int get(); void set(int value); }
Property Value
Type: System::Int32The 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).
Available since 4.0