You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the current instance of the cache exceeds the limit on memory set by the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property, the cache implementation removes cache entries. Each cache instance in the application can use the amount of memory that is specified by the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property.
428
+
> [!IMPORTANT]
429
+
> In .NET Core and .NET 5.0 and later, the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property does not have any effect. The underlying implementation for enforcing this limit is not functional outside of .NET Framework.
429
430
430
-
The settings for the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property can be specified in the application configuration file. Alternatively, they can be passed in the constructor when the <xref:System.Runtime.Caching.MemoryCache> class is initialized. For more information about how to configure this property, see [<namedCaches> Element (Cache Settings)](/dotnet/framework/configure-apps/file-schema/runtime/namedcaches-element-cache-settings). For more information about how to set this value when the <xref:System.Runtime.Caching.MemoryCache> class is being initialized, see the <xref:System.Runtime.Caching.MemoryCache.%23ctor%2A> method.
431
+
In .NET Framework (4.x), if the current instance of the cache exceeds the limit on memory set by the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property, the cache implementation removes cache entries. Each cache instance in the application can use the amount of memory that is specified by the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property. In .NET Core and later, this property returns the value from configuration or constructor parameters but is not enforced.
431
432
432
-
<xref:System.Runtime.Caching.MemoryCache> does not instantly enforce <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> each time a new item is added to a <xref:System.Runtime.Caching.MemoryCache> instance. The internal heuristics which evicts extra items from the <xref:System.Runtime.Caching.MemoryCache> does it gradually and takes into account information from the garbage collector (see [Garbage Collection](/dotnet/standard/garbage-collection/)) and other factors such as current cache size and overall system memory pressure. Therefore even though the <xref:System.Runtime.Caching.MemoryCache> tries to keep the cache size within the configured <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> it is possible to temporarily exceed the limit by adding cache items at a very high rate.
433
+
The settings for the <xref:System.Runtime.Caching.MemoryCache.CacheMemoryLimit%2A> property can be specified in the application configuration file. Alternatively, they can be passed in the constructor or by a caller when the <xref:System.Runtime.Caching.MemoryCache> instance is initialized.
433
434
434
-
]]></format>
435
+
]]></format>
435
436
</remarks>
436
437
<relatedtype="Article"href="/dotnet/framework/configure-apps/file-schema/runtime/namedcaches-element-cache-settings"><namedCaches> Element (Cache Settings)</related>
<summary>Gets the percentage of physical memory that the cache can use.</summary>
932
-
<value>The percentage of physical memory that the cache can use.</value>
932
+
<summary>Gets the percentage of total system physical memory usage at which the cache will begin evicting entries.</summary>
933
+
<value>The percentage of overall physical memory usage on the system that triggers cache eviction.</value>
933
934
<remarks>
934
935
<formattype="text/markdown"><. For more information about how to configure the property when the <xref:System.Runtime.Caching.MemoryCache> class is being initialized, see the <xref:System.Runtime.Caching.MemoryCache.%23ctor%28System.String%2CSystem.Collections.Specialized.NameValueCollection%29?displayProperty=nameWithType> method.
940
+
The settings for the <xref:System.Runtime.Caching.MemoryCache.PhysicalMemoryLimit%2A> property can be specified in the application configuration file. Alternatively, they can be passed by a caller when the <xref:System.Runtime.Caching.MemoryCache> instance is initialized.
0 commit comments