This documentation is archived and is not being maintained.

InsufficientMemoryException Class

The exception that is thrown when a check for sufficient available memory fails. This class cannot be inherited.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

<SerializableAttribute> _
Public NotInheritable Class InsufficientMemoryException _
	Inherits OutOfMemoryException
Dim instance As InsufficientMemoryException

Unlike OutOfMemoryException, InsufficientMemoryException is thrown before starting an operation, and thus does not imply state corruption. An application can catch this exception, throttle back its memory usage, and avoid actual out of memory conditions and their potential for corrupting program state.

This exception is thrown by the MemoryFailPoint constructor when you specify a projected memory allocation larger than the amount of currently available memory. Your program can catch the exception and either delay the task that needs the memory or execute it in smaller steps that require less memory.

See the MemoryFailPoint class for a code example.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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