System.OutOfMemoryException显示异常? [英] System.OutOfMemoryException Showing Exception ?

查看:94
本文介绍了System.OutOfMemoryException显示异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在C#中收到"System.outOfMemory异常"异常.

有什么办法可以克服这些例外?

请帮忙.

谢谢

Hi ,


I am getting an exception in C# " System.outOfMemory Exception".

Is there is any way to overcome these Exceptiom?

Please help.

Thanks

推荐答案

如果您陷入某种无限循环,则可以通过修复此循环来摆脱此错误.
还要查看代码的其他方面,例如,可能使用的图像较大等.

如果确实是内存问题,那么增加系统内存可能是解决问题的一种方法(尽管不能保证).
If you are getting into an infinite loop of some kind, you could get rid of this error by fixing this loop.
Also look at other aspects of code, example, large image size etc that you might be working with.

If its a genuine memory issue, then increasing the memory of the system might be one way (although not guaranteed way) to fix the problem.


您没有足够的内存来解决您的问题.操作.
我认为您可以对大型数组执行操作.
您可以尝试:
You''ve not enough memory to do your operation.
I think you do something with large arrays.
You can try to:

  1. 如果不再需要对象,请将它们设置为null.
  2. 尝试使用较小的数组进行操作!可能不需要大数组.
  3. 如果您具有大数据类型的数组,请尝试使用较小的数据类型.如果您有一个带有long的数组,请尝试使用整数.如果它不适用于整数,则需要创建long.尝试选择最小的数据类型!

  1. Set objects to null if you don''t longer need them.
  2. Try what you do with a smaller array! It''s possible that you don''t need a large array.
  3. If you''ve array with a large datatype, try a smaller datatype. If you''ve an array with longs, try it also with integers. If it doesn''t work with integers, then you need to create long. Try to choose the smallest datatype!



希望这会有所帮助.



Hope this helps.


这篇关于System.OutOfMemoryException显示异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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