program eat up memory like hell...

jorge

Well-known member
Joined
Jul 13, 2003
Messages
239
Location
Belgium
Ok, ive made an imageviewer, but it eat u^p a lot of memory,
any pionter to fix that?
below is the code i use to load the images
Code:
        PIT_image.Visible = False
        PIT_image.Image = Image.FromFile(sPath & "\" & filelist.SelectedItem)
        PIT_image.Update()
        PIT_image.Refresh()
        If chresize.Pushed = True Then
            resizeimage()
        Else
            PIT_image.Height = PIT_image.Image.Height
            PIT_image.Width = PIT_image.Image.Width
            PIT_image.Visible = True
        End If
 
I have done a similar thing, but mine was displaying images tiled on the screen, as in windows explorer with the thumbnail view. I found that when the page was filled with the tiled images, it could use up to 70-80mB in virtual memory.

What I did was to use gc.collect after each image was drawn. This seemed to throw away a lot of the memory used to create each image and kept it down around 10-15mB of VM.

Steve
 
Back
Top