如何修复Windows窗体应用程序的内存不足异常? [英] How to fix out of memory exception for Windows Forms applications?

查看:174
本文介绍了如何修复Windows窗体应用程序的内存不足异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows应用程序的窗体上有一个PictureBox,我正在设置PictureBox的imagelocation属性然后我面临这个问题



pictureBox1.ImageLocation = @c :\ 2.jpg;



我的图像超过7 mb而我面临的问题



内存不足异常

I have a PictureBox on my Form in windows appliation and i am setting imagelocation property of PictureBox then i am facing this issue

pictureBox1.ImageLocation = @"c:\2.jpg";

my image is more than 7 mb and the i am facing issue

" out of memory exception"

推荐答案

这里没有什么可讨论的。应该防止内存不足,而不是修复。如果你没有足够的内存,你还不够。这些天你的7 MB几乎没什么。无论如何,您没有提供任何相关信息,而不是示例项目。也许你的系统内存很少,也许你有内存泄漏(是的,你可以在.NET应用程序中泄漏内存,甚至可以让托管内存泄漏,这不是很明显吗?)。没有足够的信息来添加其他内容。



-SA
There is nothing much to discuss here. "Out of memory" should be prevented, not fixed. If you have not enough memory, you have not enough. Your 7 MB is next to nothing these days though. Anyway, you did not provide any relevant information, not a sample project. Maybe your system memory is scarce, maybe you have a memory leak (yes, you can have leaks of memory in a .NET application, you can even have the managed memory leaks, isn't it obvious?). Not enough information to add anything else.

—SA


这篇关于如何修复Windows窗体应用程序的内存不足异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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