Haha, well my system wouldn't even do that once, no error, it just didn't do it. I was thinking more along the lines of:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 0 To 100
Dim bmp As New Bitmap(10000, 10000)
bmp.Dispose()
Me.Text = i.ToString
Application.DoEvents()
Next
MessageBox.Show("")
End Sub
This code actually runs, albeit slowly since it's allocating 10,000 x 10,000 x 3 (Width x Height x Bytes per Pixel) = 300,000,000 bytes of memory (about 286 megabytes).
Long story short, you shouldn't have to worry about .NET and it's garbage collector.
Enter your message below
Sign in or Join us (it's free).