获取OutOfMemoryException异常运行时与消息"内存不足,无法继续执行程序和QUOT的执行; [英] Getting OutofMemoryException at runtime with the message "Insufficient memory to continue the execution of the program"

查看:360
本文介绍了获取OutOfMemoryException异常运行时与消息"内存不足,无法继续执行程序和QUOT的执行;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到OutOfMemoryException异常运行时消息内存不足,无法继续执行程序。我加载图像在节目的开始。每幅图像是50 + MB。如果图像尺寸变为277 MB加,然后我得到这个例外。我加载图像一次,因为我在开始施展缩略图。

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.

感谢

推荐答案

您也许可以尝试让你的程序访问更多的内存,但是这将是一场斗争。对于.NET应用程序的内存量是由你的machine.config文件中processModel / MemoryLimit设置控制。 Microsoft建议您将其设置不高于60%。

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%.

不过,要装载50多MB的图像,全部一次,以显示缩略图(这可能是微小的大小)。我认为,这是您进行更改。你可以加载您的图像一个接一个,然后生成缩略图和释放内存,立竿见影。

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.

在任何情况下,具有50 MB +图像是当你试图显示缩略图效率不高。你就不能保存的缩略图,而不是每次都产生呢?

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?

这篇关于获取OutOfMemoryException异常运行时与消息"内存不足,无法继续执行程序和QUOT的执行;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆