MemoryCacheElement.PhysicalMemoryLimitPercentage Property

.NET Framework (current version)

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

Namespace:   System.Runtime.Caching.Configuration
Assembly:  System.Runtime.Caching (in System.Runtime.Caching.dll)

	DefaultValue = 0)]
[IntegerValidatorAttribute(MinValue = 0, MaxValue = 100)]
public int PhysicalMemoryLimitPercentage { get; set; }

Property Value

Type: System.Int32

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).

.NET Framework
Available since 4.0
Return to top