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)

public bool DisableMemoryCollection { get; set; }
/** @property */
public boolean get_DisableMemoryCollection ()

/** @property */
public void set_DisableMemoryCollection (boolean value)

public function get DisableMemoryCollection () : boolean

public function set DisableMemoryCollection (value : boolean)

Not applicable.

Property Value

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.

// Get the current DisableMemoryCollection property value.
Boolean disableMemoryCollectionValue = 

// Set the DisableMemoryCollection property to false.
cacheSection.DisableMemoryCollection = false;

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0