System.OutOfMemoryException Class

public class OutOfMemoryException : SystemException

Base Types

Object
  Exception
    SystemException
      OutOfMemoryException

Assembly

mscorlib

Library

BCL

Summary

Represents the error that occurs when insufficient memory prevents the current memory allocation from succeeding.

Description

[Note: The following IL instructions throw OutOfMemoryException:

]

See Also

System Namespace

Members

OutOfMemoryException Constructors

OutOfMemoryException() Constructor
OutOfMemoryException(System.String) Constructor
OutOfMemoryException(System.String, System.Exception) Constructor


OutOfMemoryException() Constructor

public OutOfMemoryException();

Summary

Constructs and initializes a new instance of the OutOfMemoryException class.

Description

This constructor initializes the System.OutOfMemoryException.Message property of the new instance to a system-supplied message that describes the error, such as "There was not enough memory to continue the execution of the program." This message takes into account the current system culture.

The System.OutOfMemoryException.InnerException property is initialized to null .

See Also

System.OutOfMemoryException Class, System Namespace

OutOfMemoryException(System.String) Constructor

public OutOfMemoryException(string message);

Summary

Constructs and initializes a new instance of the OutOfMemoryException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.

Description

This constructor initializes the System.OutOfMemoryException.Message property of the new instance using message. If message is null , the System.OutOfMemoryException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments. The System.OutOfMemoryException.InnerException property is initialized to null .

See Also

System.OutOfMemoryException Class, System Namespace

OutOfMemoryException(System.String, System.Exception) Constructor

public OutOfMemoryException(string message, Exception innerException);

Summary

Constructs and initializes a new instance of the OutOfMemoryException class.

Parameters

message
A String that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
innerException
An instance of Exception that is the cause of the current Exception. If innerException is non-null, then the current Exception was raised in a catch block handling innerException .

Description

This constructor initializes the System.OutOfMemoryException.Message property of the new instance using message, and the System.OutOfMemoryException.InnerException property using innerException. If message is null , the System.OutOfMemoryException.Message property is initialized to the system-supplied message provided by the constructor that takes no arguments.

[Note: For information on inner exceptions, see System.Exception.InnerException .]

See Also

System.OutOfMemoryException Class, System Namespace