错误“在PresentationFramework.dll中发生了'System.OutOfMemoryException'类型的第一次机会异常。 [英] ERROR " A first chance exception of type 'System.OutOfMemoryException' occurred in PresentationFramework.dll"

查看:440
本文介绍了错误“在PresentationFramework.dll中发生了'System.OutOfMemoryException'类型的第一次机会异常。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道你是否可以帮我解决这个问题:我的代码工作了几天,但是当我今天尝试运行时...它一直给我这个错误类型'系统的第一次机会例外.OutOfMemoryException'发生在PresentationFramework.dll中这是一个WPF应用程序,我在所有页面中都出现此错误。我尝试了内存诊断工具......但内存没有问题。每次我调试..解决方案使用大量的内存..请帮助





![这是我得到的当我运行解决方案,它在每次初始化时几乎在所有页面中都会出现此错误] [1]









[1]:http://i.stack.imgur.com/AnPZ0.png [1]

Just wondered if you could please help me with this: I had my code working in a couple days, but as I tried running it as for today..it keeps giving me this ERROR " A first chance exception of type 'System.OutOfMemoryException' occurred in PresentationFramework.dll" This is a WPF Application and I get this Error in all the pages. I tried Memory Diagnosing tool...but there no problem with the memory. Everytime I debug..the solution uses a high amount of memory.. please Help


![This is what I get when I run the solution, it brings this error in almost all the pages every time they are initialized ][1]




[1]: http://i.stack.imgur.com/AnPZ0.png [1]

推荐答案

只是错误信息,你无法告诉你什么是错的。有一千种不同的方法让你运行机器内存不足。



但是,通常,这是因为你要么:



A)已分配的对象但从未发布对它们的所有引用并继续分配更多对象,从而使机器内存不足,



B)你没有在你真正应该调用Dispose的对象上调用Dispose。根据经验,如果对象具有Dispose方法,则在完成对象时调用它!
Just by the error message it is impossible to tell you what's wrong. There are a thousand different ways for you to run the machine out of memory.

But, usually, this is because you either:

A) Allocated objects but never released all references to them and continued to allocate more objects, thereby running the machine out of memory,

B) You're not calling Dispose on objects that you really should be calling Dispose on. As a rule of thumb, if an object has a Dispose method, call it when you're done with the object!


这篇关于错误“在PresentationFramework.dll中发生了'System.OutOfMemoryException'类型的第一次机会异常。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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