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.
When data structures or data sets that reside in memory become so large that the common language runtime is unable to allocate enough contiguous memory for them, an OutOfMemoryException exception results.
void Foo() { throw new OutOfMemoryException(); }
:)))
Create a very, very large string. Probably:
string s = new string('a', int.MaxValue);
will be enough.
If not, you can concat it to build even bigger string.
string ss = string.Concat(s, s);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With