1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System
.Runtime
.Serialization
;
10 /// The exception class for OOM.
13 [System
.Runtime
.CompilerServices
.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
14 public class OutOfMemoryException
: SystemException
16 public OutOfMemoryException() : base(
18 GetMessageFromNativeResources(ExceptionMessageKind
.OutOfMemory
)
20 SR
.Arg_OutOfMemoryException
24 HResult
= HResults
.COR_E_OUTOFMEMORY
;
27 public OutOfMemoryException(string? message
)
30 HResult
= HResults
.COR_E_OUTOFMEMORY
;
33 public OutOfMemoryException(string? message
, Exception
? innerException
)
34 : base(message
, innerException
)
36 HResult
= HResults
.COR_E_OUTOFMEMORY
;
39 protected OutOfMemoryException(SerializationInfo info
, StreamingContext context
) : base(info
, context
)