using System.Runtime;
class Program
{
static void Main()
{
// This program for some reason needs a huge amount of memory.
using (MemoryFailPoint point = new
MemoryFailPoint(
1000000))
{
// An exception is thrown at this point.
// ... The computer does not have enough memory.
// ... So we do not need to execute the inner code.
}
}
}
Unhandled Exception: System.InsufficientMemoryException:
Insufficient memory to meet the expected demands of an operation,
and this system is likely to never satisfy this request.
If this is a 32 bit system, consider booting in 3 GB mode.
at System.Runtime.MemoryFailPoint..ctor(Int32 sizeInMegabytes)
at Program.Main()...