|
I have a problem when loading some pretty large images. The images are ~700mb uncompressed, and the two first times I load an image, everything works fine.
Each time I'm done with an image, I force a Garbage Collection using GC.Collect() and I can see in the task manager that resources are actually being released.
The weird thing is that when I load the third image to process (it's the same function called from a loop), I always get an OutOfMemory exception. (note: the third image is not always the same image file)
Not even closing and disposing the worker thread and restarting it wil cut it. I have to exit the whole application to make it run again without the memory exception.
Any ideas on what I can do to prevent this is highly appreciated.
(The best thing was probably to be able to read pixels in the the tiff file by directly accessing the file, instead of loading the whole file into memory.) |