views:

38

answers:

2

Hi,

I am getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program.". I am loading the images at the start of program. Each image is 50+ MB. If the images size goes to 277 MB plus, then I get this exception. I am loading the images at once because I have to display their thumbnails at start.

I was thinking of caching and paging solution. I there any possibility to use more memory of the system or somehow other solution.

Thanks

+1  A: 

You could probably try to allow your program to access more memory, but it would be a struggle. For a .NET application, the amount of memory is controlled by the processModel/memoryLimit setting in your machine.config file. Microsoft recommends that you set it no higher than 60%.

However, you are loading 50+ MB images, all at once, to display thumbnails (which are probably tiny in size). I suggest that this is where you make your change. You could load your images one by one, then generate the thumbnail and free the memory straight away.

In any case, having 50 MB+ images is not efficient when you are trying to show a thumbnail. Can't you just save the thumbnails and not have to generate them every time?

Hugo Migneron
Thanks Hugo. Thats the nice idea.
Saghar
+3  A: 
Richard