The exception that is thrown when a check for sufficient available memory fails. This class cannot be inherited.
See Also: InsufficientMemoryException Members
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 System.Runtime.MemoryFailPoint.#ctor(int) 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 System.Runtime.MemoryFailPoint class for a code example.