Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
OutOfMemoryException Class
Collapse the table of content
Expand the table of content

OutOfMemoryException Class

The exception that is thrown when there is not enough memory to continue the execution of a program.

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

[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public class OutOfMemoryException : SystemException
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public class OutOfMemoryException extends SystemException
SerializableAttribute 
ComVisibleAttribute(true) 
public class OutOfMemoryException extends SystemException
Not applicable.

The following Microsoft intermediate (MSIL) instructions throw OutOfMemoryException :

  • box

  • newarr

  • newobj

OutOfMemoryException uses the HRESULT COR_E_OUTOFMEMORY, which has the value 0x8007000E.

For a list of initial property values for an instance of OutOfMemoryException, see the OutOfMemoryException constructors.

NoteNote:

The value of the inherited Data property is always a null reference (Nothing in Visual Basic).

Windows Mobile 2003 for Pocket PC, Windows Mobile 2003 for Smartphone, Windows CE Platform Note: To limit this exception from occurring in resource constrained devices, avoid using methods that consume 64 or more kilobytes of memory.

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 Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2015 Microsoft