在程序啓動過程中偶爾出現內存異常。堆棧跟蹤如下。我只在客戶機器上得到這個崩潰。內存不足異常
我應該遵循哪些步驟來確定根本原因?
[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