C# OutOfMemoryException - How to track down the culprit

半城伤御伤魂 提交于 2019-12-06 00:24:37

Since you are a 'small panel PC', maybe you are calling some non-'.Net' code to control some hardware. Is so, maybe that part of the program might be using a fair amout of memory (but still not leaking any). To get the garbage collector to work harder in that case, look into adding a GC.AddMemoryPressure() call.

BabaBooey

It turns out that a variety of issues were causing my application to crash. I've detailed them in another post here.

I came across a very good article that examines the error in depth.

WPF Render Thread Errors

The most telling paragaph: don't bother trying to analyze the call stack you're given:

Due to the design, unfortunately, the exception and callstack you see on the UI thread aren't typically helpful in diagnosing the true cause of the problem. This is because by the time the exception is thrown, it is already after the point of failure on the render thread. By this time, critical state has been lost on the render thread that would help us understand where and why the failure occurred.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!