在程序启动过程中偶尔出现内存异常。堆栈跟踪如下。我只在客户机器上得到这个崩溃。内存不足异常
我应该遵循哪些步骤来确定根本原因?
[369][4/29/2011 18:32:15:343]-ERR -[ThreadId = 7916, UIFramework_ICEVisionPro_GUIExceptionHandler.LogException]-System.OutOfMemoryException: Out of memory.
at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc)
at System.Drawing.BufferedGraphicsContext.CreateBuffer(IntPtr src, Int32 offsetX, Int32 offsetY, Int32 width, Int32 height)
at System.Drawing.BufferedGraphicsContext.AllocBuffer(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
at System.Drawing.BufferedGraphicsContext.AllocBufferInTempManager(Graphics targetGraphics, IntPtr targetDC, Rectangle targetRectangle)
at System.Drawing.BufferedGraphicsContext.Allocate(IntPtr targetDC, Rectangle targetRectangle)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.UserControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
你正在做任何'位图'对象和处理相同?如果是这样,我相信没有足够的内存可用于执行相同的进程 – V4Vendetta 2011-05-10 07:54:55
您是否处置所有非托管资源? – dandan78 2011-05-10 07:56:52
@ dandan78:我不确定。这是因为有些屏幕是我们开发的,有些是由客户开发的。是否有任何工具可以确定是否在应用程序中的非托管资源上调用了dispose? – Maanu 2011-05-10 08:01:39