Export (0) Print
Expand All

InsufficientMemoryException Class

Note: This class is new in the .NET Framework version 2.0.

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 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.

System.Object
   System.Exception
     System.SystemException
       System.OutOfMemoryException
        System.InsufficientMemoryException

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 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft