Gets the amount of memory on the computer, in bytes, that can be used by the cache.
Assembly: System.Runtime.Caching (in System.Runtime.Caching.dll)
If the current instance of the cache exceeds the limit on memory set by theproperty, the cache implementation removes cache entries. Each cache instance in the application can use the amount of memory that is specified by the property.
The settings for the MemoryCache class is initialized. For more information about how to configure this property, see <namedCaches> Element (Cache Settings). For more information about how to set this value when the MemoryCache class is being initialized, see the MemoryCache method.property can be specified in the application configuration file. Alternatively, they can be passed in the constructor when the
MemoryCache does not instantly enforce each time a new item is added to a MemoryCache instance. The internal heuristics which evicts extra items from the MemoryCache does it gradually and takes into account information from the garbage collector (see Garbage Collection) and other factors such as current cache size and overall system memory pressure. Therefore even though the MemoryCache tries to keep the cache size within the configured it is possible to temporarily exceed the limit by adding cache items at a very high rate.
Available since 4.0