我一直在处理这个很长一段时间。有时它会抛出无效的操作异常,有时会导致内存不足。随机用户可以在一天内多次运行并崩溃。WPF应用程序与OOM异常随机崩溃
我得到了一个用户的调用堆栈,并且无法理解可能导致此问题的原因。这是一个带有丰富UI的WPF应用程序。许多观点,列表。使用PRISM和区域。
它还使用后台线程来侦听TCP,刷新数据并在UI线程上发送PRISM通知以进行更新。这个堆栈是否提供了我可能需要检查的线索?这不是起源于我的代码..
在 MS.Utility.ArrayItemList
1[[System.Windows.Freezable+FreezableContextPair, WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]..ctor(Int32) at MS.Utility.FrugalObjectList
1 [System.Windows.Freezable + FreezableContextPair, WindowsBase,版本= 4.0.0.0,文化=中立, 公钥= 31bf3856ad364e35 (Int32)at MS.Utility.FrugalObjectList` [[System.Windows.Freezable + FreezableContextPair, WindowsBase,Version = 4.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35]]。Insert(Int32, FreezableContextPair) at System.Windows.Freezable.AddContextToList(System.Windows.DependencyObject, System.Windows.De pendencyProperty)在 System.Windows.Freezable.AddContextInformation(System.Windows.DependencyObject, System.Windows.DependencyProperty)处 System.Windows.Freezable.AddInheritanceContext(System.Windows.DependencyObject, System.Windows.DependencyProperty) System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(System.Windows.DependencyObject, System.Windows.DependencyProperty)在 System.Windows.Freezable.OnFreezablePropertyChanged(System.Windows.DependencyObject, System.Windows.DependencyObject,System.Windows.DependencyProperty)
at System.Windows.Media.RenderData.PropagateChangedHandler(System.EventHandler, 布尔型)在 System.Windows.UIElement.RenderClose(System.Windows.Media.IDrawingContent) 在 System.Windows.Media.VisualDrawingContext.CloseCore(System.Windows.Media.RenderData) 在System.Windows.Media。 RenderDataDrawingContext.DisposeCore() System.Windows.Media.DrawingContext.System.IDisposable.Dispose()at System.Windows.Media.RenderDataDrawingContext.Close()at System.Windows.UIElement.Arrange(System.Windows.Rect )在 System.Windows.Controls.DataGridCellsPanel.ArrangeChild(System.Windows.UIElement, 的Int32,ArrangeState)在 System.Windows.Controls.DataGridCellsPanel.ArrangeOverride(System.Windows.Size) 在System.Windows.FrameworkElemen t.ArrangeCore(System.Windows.Rect)
at System.Windows.UIElement.Arrange(System.Windows.Rect)at MS.Internal.Helper.ArrangeElementWithSingleChild(System.Windows.UIElement, System.Windows.Size)在 System.Windows.Controls.ItemsPresenter.ArrangeOverride(System.Windows.Size) 在System.Windows.FrameworkElement.ArrangeCore(System.Windows.Rect)
在System.Windows.UIElement.Arrange(System.Windows.Rect )在 System.Windows.Controls.Control.ArrangeOverride(System.Windows.Size)
在 System.Windows.Controls.Primitives.DataGridCellsPresenter.ArrangeOverride(System.Windows.Size) 在System.Windows.FrameworkE lement.ArrangeCore(System.Windows。矩形)
在System.Windows.UIElement.Arrange(System.Windows.Rect)在 System.Windows.Controls.Grid.ArrangeOverride(System.Windows.Size)
在System.Windows.FrameworkElement.ArrangeCore(系统。 Windows.Rect)
在System.Windows.UIElement.Arrange(System.Windows.Rect)在 System.Windows.Controls.Border.ArrangeOverride(System.Windows.Size)
在System.Windows.FrameworkElement.ArrangeCore( System.Windows.Rect)
at System.Windows.UIElement.Arrange(System.Windows.Rect)at System.Windows.Controls.Control.ArrangeOverride(System.Windows.Size)
at System.Windows.Controls.DataGridRow.ArrangeOverride(System.Windows.Size) at System.Windows.FrameworkElement.ArrangeCore(System.Windows.Rect)
at System.Windows.UIElement.Arrange(System.Windows.Rect)在 System.Windows.Controls.VirtualizingStackPanel.ArrangeOtherItemsInExtendedViewport(布尔, System.Windows.UIElement,System.Windows.Size,双,的Int32, System.Windows.Rect的ByRef,System.Windows.Size的ByRef, System.Windows .Point ByRef,Int32 ByRef)at System.Windows.Controls.VirtualizingStackPanel.ArrangeOverride(System.Windows.Size) at System.Windows.FrameworkElement.ArrangeCore(System.Windows.Rect)
at System.Windows.UIElement .Arrange(System.Windows.Rect)在 System.Windows.ContextLayoutManager.UpdateLayout()在 System.Windows.ContextLayoutManager.UpdateLayoutCallback(System.Object的) 在System.Windows.Media.MediaContext + InvokeOnRenderCallback.DoWork()
处 System.Windows.Media.MediaContext.RenderMessageHandler(System.Object的)System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(System.Object的) 在 MS.Intern。System.InWindows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object,Int32)at al.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object的, System.Delegate,System.Object的,的Int32,System.Delegate)在 System.Windows.Threading.DispatcherOperation.InvokeImpl()在 System.Windows.Threading.DispatcherOperation。 InvokeInSecurityContext(System.Object的) 处 System.Threading.ExecutionContext.Run(的System.Threading System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object的,布尔值)。 ExecutionContext, System.Threading.ContextCallback,System.Object,Boolean) System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object)at System.Windows.Threading.DispatcherOperation.Invoke()在 System.Windows.Threading.Dispatcher.ProcessQueue()在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr的,的Int32,IntPtr的, IntPtr的,布尔的ByRef)在MS.Win32.HwndWrapper.WndProc(IntPtr, Int32,IntPtr,IntPtr,Boolean ByRef)at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object的,Int32)将在在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object的, System.Delegate,System.Object的,的Int32,System.Delegate)( System.Windows。Threading.DispatcherPriority, System.TimeSpan,System.Delegate,System.Object的,Int32)将在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr的,的Int32,IntPtr的,IntPtr的)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(系统.Windows.Interop.MSG 的ByRef)在 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) 在 System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.Run()at System.Windows.Application.RunDispatcher(System.Object)at System.Windows.Application.RunInternal(System.Windows.Window)at System.Windows.Application.Run(System.Windows.Window)在 ArturExpress.Main.App.Main()
我建议使用一些分析器来查看实际发生的事情。从描述中很难猜出... – walther 2014-08-27 14:34:04
堆栈跟踪的实际异常是什么?是OutOfMemoryException还是别的?另外,有没有内部的例外? – user469104 2014-08-27 14:35:09
不幸的是我无法追查它。这是不可复制的,随机发生在用户机器上(可以好几天)。该堆栈跟踪来自事件日志。这是OutOfMemoryException。 – katit 2014-08-27 14:41:37