WPF 内存不足异常
Posted
技术标签:
【中文标题】WPF 内存不足异常【英文标题】:WPF Out of memory exception 【发布时间】:2017-07-20 07:16:27 【问题描述】:我有一个 WPF 应用程序,它在生产中运行良好,直到上周。根本没有任何变化,但它开始变慢并因以下错误而崩溃。这是基于 .NET 4.0 构建的,并且已经投入生产多年。对此的任何意见都将受到高度赞赏。尝试了许多从开发环境复制的方法,但根本没有发生。
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.OutOfMemoryException
at System.Windows.DependencyObject.InsertEntry(System.Windows.EffectiveValueEntry, UInt32)
at System.Windows.DependencyObject.SetEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(System.Windows.Media.Visual, System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
at System.Windows.UIElement.OnIsEnabledChanged(System.Windows.DependencyObject, System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs)
at System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, System.Windows.EffectiveValueEntry ByRef, Boolean, Boolean, System.Windows.OperationType)
at System.Windows.DependencyObject.CoerceValue(System.Windows.DependencyProperty)
at System.Windows.FrameworkElement.InvalidateForceInheritPropertyOnChildren(System.Windows.DependencyProperty)
The remainder of the message was truncated.
Exception Info: System.InvalidOperationException
选中时,用户 PC 中仅安装了 .NET 4.7。只是想知道这是否可能与 .NET Framework 版本相关联?
【问题讨论】:
您有任何相关代码可以帮助我们找到问题吗?事实上,这个问题很模糊。 很遗憾没有。我仍在检查是哪部分代码导致了这种情况。 我在connect.microsoft.com/VisualStudio/feedback/details/3138410 创建了一个连接问题来跟踪这个问题。如果您能够收集内存转储(@codekaizen 的建议我很贴切),请您通过 Connect 链接与我们分享吗?报告中显示的特定堆栈可能不是发生内存不足情况的位置。 @Arun - 您是否能够获得故障转储或其他可操作的证据?如果是这样,请将其附加到 Vatsan 创建的 Connect 错误中。我们担心这可能是 .Net 4.7 的问题,但我们无法重现该问题,因此我们需要您的证据。缺少这一点,我们将不得不以 NotRepro 的形式解决该错误。 不幸的是,还没有可操作的证据。要求用户从现在开始尝试较低版本的 .NET。尚未获得反馈。 【参考方案1】:您可以在生产环境中做的一件事是使用procmon.exe
from Sysinternals (Microsoft)。您只需要 exe 即可从磁盘或 USB 驱动器甚至网络共享运行它。
您可以将其设置为在OutOfMemoryException
上转储进程内存:
procdump -ma -e 1 -f OutOfMemoryException -w "<Your Process Name>"
或者,您可以将其配置为在内存超过阈值时触发转储:
procdump -ma -m 1000 -w "<Your Process Name>" -n 20 -s 60
这会将 procdump 设置为为名为
拥有转储 (.dmp) 文件后,您可以使用各种工具(我喜欢 .Net Memory Profiler 但 PerfView 或 WinDbg with SOS work well, too)来检查转储的堆内存,以确定是否有对象应该不在记忆中。对于 WPF,有典型的罪魁祸首,and property binding (what your callstack is showing) is one of them。
【讨论】:
谢谢!我会试试的!【参考方案2】:互联网上有类似的报道,关于相同的callstack
不断重复导致异常,你会得到一个OutOfMemoryException
,但你也可以得到一个***Exception
或其他。
这里有类似的问题:error 1 - error 2
不幸的是,调用堆栈不足以了解问题的根源,因此我的建议是在客户端计算机上使用远程调试器来检索有关该问题的更多信息。
【讨论】:
感谢您的建议。现在我也不清楚是哪一部分代码导致了这种情况。我会按照你的建议尝试远程调试器。 这些似乎与@Arun 的问题不同。 @Vatsan:确实如此,95% 的调用堆栈是相同的,PropertyChanged -> InvalidateForceInheritPropertyOnChildren -> Coerce ... 它们不一样。 1 是由于 Intellisense 中的可重入集合更改导致的 OutOfRange 异常,2 是 5 年前修复的 Diagram 中的 NullReference 异常。对于 OutOfMemory,调用堆栈不一定相关 - 只是内存用完时发生的情况。故障转储更有用。以上是关于WPF 内存不足异常的主要内容,如果未能解决你的问题,请参考以下文章