Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have written a program in VB.Net that essentailly can create a mosaic picture. It opens the smaller tile pictures, does some processing, and then weaves the smaller tiles into the larger mosaic picture. The program works fine except that with large images (over about 2000x2000 pixels), I get an "Out of Memory Error".

 

I am running the program on a Windows 2K, P4, with 512MB of RAM and the VM set at about 1.5GB. As I watch in the Performance section of the Task Manager, the program usually only takes about 20MB, but the VM obviously is out of control.

 

I am using 2 graphics objects and 2 bitmap objects as I shuffle the images around in processing. In each pass through the loop building my mosaic, I am using a:

 

graphics = nothing

graphics.dispose()

-- or a --

bitmap = nothing

bitmap.dispose()

 

So I think I am releasing my stored resources. What can be done to either be more efficient with clearing the memory or using the variables in a cleaner way?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...