Hi,
I'm sure this is a n00b question but why does multiple clicks of the button in this code run memory up? It's like memory isn't released after each execution.
blank.gif is a "blank" gif of 2.33KB
Sub App_Start
Form1.Show
Image1.LoadPicture("blank.gif")
End Sub
Sub Button1_Click
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Image1.LoadPicture("blank.gif")
Return
End Sub
It won't be until the .NET garbage collector runs. Don't worry about memory unless you get an out of memory error. In .NET the memory management is all taken care of for you.
As you didn't post blank.gif I have no idea how big the picture it represents is, but just because the gif is small it doesn't mean the resulting bitmap is. One problem is that the .NET grabage collector thinks that a Bitmap is small because it only takes up a tiny amount of managed memory, but you are probably running out of conventional memory which is where the real bitmap memory is allocated.
Out of interest how are you managing to compile your application with what I assume is the trial version as you don't appear to be a registered user?