求助一个C# WinForm下,关于System.OutOfMemoryException的一个问题
我用WCF寄宿在C# WinForm下,WCF使用的是netTCPBinding,并且使用了回调,WINFORM中加载了多个动态库,其中动态库在其它软件(如DELPHI中已经使用,非常稳定)。现在有这么一个问题,软件运行16~20个小时后自动崩溃退出了,我在主线程捕获的异常为:
CurrentDomain_UnhandledException-->2012-4-4 16:02:36 出现应用程序未处理的异常
异常类型:OutOfMemoryException
异常消息:Exception of type 'System.OutOfMemoryException' was thrown.
异常位置:
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d)
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d)
at System.Windows.Forms.UnsafeNativeMethods.SetWindowLongPtr32(HandleRef hWnd, Int32 nIndex, WndProc wndproc)
at System.Windows.Forms.UnsafeNativeMethods.SetWindowLong(HandleRef hWnd, Int32 nIndex, WndProc wndproc)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle, Boolean assignUniqueID)
at System.Windows.Forms.NativeWindow.AssignHandle(IntPtr handle)
at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.IntCreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Timer.TimerNativeWindow.EnsureHandle()
at System.Windows.Forms.Timer.TimerNativeWindow.StartTimer(Int32 interval)
at System.Windows.Forms.Timer.set_Enabled(Boolean value)