Bitmaps
-
This is a Compact framework question... I'm building this application that deals with a lot of images coming from the network (~30 k a piece). I am starting to see serious memory issues arise after a while. While my images are mostly cached and the cache is cleaned up if you play with the app for long enough you get an out of memory exception. I can see the app running with up to 25 megabytes of memory in use, the problem is I'm not entirely sure what is causing this. My best guess is that the bitmap caches the decompressed version of the image after its been shown on the picturebox, either that or the picturebox does. Is there a way to reduce the memory footprint while still having that amount of images (roughly 30) in memory, the only way I can think of is to not put the actual bitmap on the display but rather a copy and after the bitmap has been shown to let the garbage collector handle the copy, however I'm pretty sure that thats going to hurt performance. Any other idea's?
-
This is a Compact framework question... I'm building this application that deals with a lot of images coming from the network (~30 k a piece). I am starting to see serious memory issues arise after a while. While my images are mostly cached and the cache is cleaned up if you play with the app for long enough you get an out of memory exception. I can see the app running with up to 25 megabytes of memory in use, the problem is I'm not entirely sure what is causing this. My best guess is that the bitmap caches the decompressed version of the image after its been shown on the picturebox, either that or the picturebox does. Is there a way to reduce the memory footprint while still having that amount of images (roughly 30) in memory, the only way I can think of is to not put the actual bitmap on the display but rather a copy and after the bitmap has been shown to let the garbage collector handle the copy, however I'm pretty sure that thats going to hurt performance. Any other idea's?
You do call Dispose() on images you no longer need, do you? If that doesn't help, show us some code. :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
This is a Compact framework question... I'm building this application that deals with a lot of images coming from the network (~30 k a piece). I am starting to see serious memory issues arise after a while. While my images are mostly cached and the cache is cleaned up if you play with the app for long enough you get an out of memory exception. I can see the app running with up to 25 megabytes of memory in use, the problem is I'm not entirely sure what is causing this. My best guess is that the bitmap caches the decompressed version of the image after its been shown on the picturebox, either that or the picturebox does. Is there a way to reduce the memory footprint while still having that amount of images (roughly 30) in memory, the only way I can think of is to not put the actual bitmap on the display but rather a copy and after the bitmap has been shown to let the garbage collector handle the copy, however I'm pretty sure that thats going to hurt performance. Any other idea's?
Aurigma.com has an extension to .NET (GraphicsMill) that allows creating and saving TIFF images with LZW compression. Besides saving memory, compression also speeds up loading, saving, and transmitting images.