Not Freeing Memory ( Reading Images)

D

Dundy

Hi,

Are there any know bugs with reading images from file and not freeing the
object after?

We are reading numerouse image scans, which are in .PNG format and finding
that the garbage collector is not freeing the memory after reading the
images.

Any help would be most appreciated,

Bruce
 
B

Bruce Wood

I have found through experience that you should call Dispose() on an
Image after you're done with it, or the garbage collector won't reclaim
the space.
 
A

Alan Pretre

Dundy said:
Are there any know bugs with reading images from file and not freeing the
object after?

We are reading numerouse image scans, which are in .PNG format and finding
that the garbage collector is not freeing the memory after reading the
images.

Besides calling Dispose() when appropriate, be careful when copying
references around in your app. If you end up with a root level reference
that never goes out of scope, it will keep an object alive through GC.

-- Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top