This documentation is archived and is not being maintained.

CacheSection.DisableMemoryCollection Property

Gets or sets a value indicating whether the cache memory collection is disabled.

Namespace:  System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("disableMemoryCollection", DefaultValue = false)]
public bool DisableMemoryCollection { get; set; }

Property Value

Type: System.Boolean
true if the cache memory collection is disabled; otherwise, false. The default is false.

If the DisableMemoryCollection property is set to true, calls to the cache-related API will have no effect.

If the DisableMemoryCollection property is set to true, the cache does not attempt to collect unused items. Use caution when using this setting, as disabling memory collection can quickly lead to Out of Memory conditions for the application.

This setting has no effect on the ASP.NET internal cache or on the output cache. For more information about the different types of cache, see ASP.NET Caching.

The following code example shows how to use the DisableMemoryCollection property.

// Enable or disable memory collection.
cacheSection.DisableMemoryCollection = 
        !cacheSection.DisableMemoryCollection;

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: