What's the easiest way to get an OutOfMemoryException in C#?

Viewed 5637

Just curious as to how I can get this error the easiest way.

Once I was trying to create a file navigator and I was creating Image thumbnails; that turned out awful.

6 Answers
var x = new long[Int32.MaxValue];

That should do it.

Related