Assembly: mscorlib (in mscorlib.dll)
[SerializableAttribute] public sealed class InsufficientMemoryException : OutOfMemoryException
/** @attribute SerializableAttribute() */ public final class InsufficientMemoryException extends OutOfMemoryException
SerializableAttribute public final class InsufficientMemoryException extends OutOfMemoryException
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.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.