Friday 23 September 2011

Quickest way to generate OutOfMemory exception

One of the quickest way (I am sure there are many) to reproduce an OutOfMem exception in .NET:

1> Drag a textbox on WPF window

2> In XAML, set TextChanged event on the added text box

3> In the TextChanged event, write a line which sets a text on the same textbox which generates this event
for .e.g txtCheckException.Text = “something”;

4> Run the application and enter a keystroke in the textbox.

Error

The event would raised again and again, and very soon (well seconds) you will get the OutOfMemory exception.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Shorts - week 3, 2022

Post with links to what I am reading: 1. A very good post on different aspects of system architecture: https://lethain.com/introduction-to-a...