Welcome Guest Search | Active Topics | Sign In | Register

EO.WebBrowser: OutOfMemory Exception Options
Klaus
Posted: Tuesday, April 24, 2018 4:27:25 AM
Rank: Newbie
Groups: Member

Joined: 4/24/2018
Posts: 1
Hi,

our application (not a child process) sometimes crashes with an OutOfMemoryException or a "MapViewOfFile failed" exception while creating an WebControl instance. Any ideas what could go wrong or what we could do to prevent this from happening?


Windows 10, .NET Framework 4.5.2, EO.WebBrowser 18.1.31.0

System.OutOfMemoryException
HResult=0x8007000E
Message=Eine Ausnahme vom Typ "System.OutOfMemoryException" wurde ausgelöst.
Source=EO.Base
StackTrace:
at EO.Internal.a93.a(String& A_0, Int32& A_1)
at EO.Internal.jo.o.a(a93 A_0)
at EO.Internal.jo.a(Boolean& A_0, a93[] A_1, String A_2, String A_3)
at EO.Internal.jo.a(a93[] A_0, String A_1, String A_2)
at EO.Internal.aqe.a(String A_0, String A_1)
at EO.Internal.av6.b()
at EO.Internal.av6.a(WindowsIdentity A_0)
at EO.WebEngine.Engine.Start(WindowsIdentity user)
at EO.Internal.av6.d()
at EO.Internal.cr..ctor(WebView A_0)
at EO.WebBrowser.WebView.y()
at EO.WebBrowser.WebView.a(IntPtr A_0, Boolean A_1)
at EO.WebBrowser.WebView.Create(IntPtr hWnd)
at EO.Wpf.WebViewHost.a.a(HandleRef A_0)
at System.Windows.Interop.HwndHost.BuildWindow(HandleRef hwndParent)
at System.Windows.Interop.HwndHost.BuildOrReparentWindow()
at System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
at System.Windows.SourceChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
at System.Windows.PresentationSource.OnVisualAncestorChanged(DependencyObject uie, AncestorChangedEventArgs e)
at System.Windows.UIElement.OnVisualAncestorChanged(Object sender, AncestorChangedEventArgs e)
at System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
at System.Windows.Media.Visual.AddVisualChild(Visual child)
at System.Windows.Controls.Decorator.set_Child(UIElement value)
at EO.Wpf.WebViewHost.OnApplyTemplate()
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Border.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.Control.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
at System.Windows.Interop.HwndTarget.OnResize()
at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at iSOFT.ServiceModule.Framework.PresentationManager.UIL.ShellWindow.NativeMethods.CallWindowProc(IntPtr prevWndProc, IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)
at iSOFT.ServiceModule.Framework.PresentationManager.UIL.ShellWindow.ShellWindowProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam)



System.Exception: MapViewOfFile failed, Win32 Error: 8
bei EO.Internal.a99.a(String& A_0, Int32& A_1)
bei EO.Internal.jr.o.a(a99 A_0)
bei EO.Internal.jr.a(Boolean& A_0, a99[] A_1, String A_2, String A_3)
bei EO.Internal.jr.a(a99[] A_0, String A_1, String A_2)
bei EO.Internal.aqk.a(String A_0, String A_1)
bei EO.Internal.awc.b()
bei EO.Internal.awc.a(WindowsIdentity A_0)
bei EO.WebEngine.Engine.Start(WindowsIdentity user)
bei EO.Internal.awc.d()
bei EO.Internal.cr..ctor(WebView A_0)
bei EO.WebBrowser.WebView.y()
bei EO.WebBrowser.WebView.a(IntPtr A_0, Boolean A_1)
bei EO.WebBrowser.WebView.Create(IntPtr hWnd)
bei EO.Wpf.WebViewHost.a.a(HandleRef A_0)
bei System.Windows.Interop.HwndHost.BuildWindow(HandleRef hwndParent)
bei System.Windows.Interop.HwndHost.BuildOrReparentWindow()
bei System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
bei System.Windows.SourceChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
bei System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
bei System.Windows.PresentationSource.OnVisualAncestorChanged(DependencyObject uie, AncestorChangedEventArgs e)
bei System.Windows.UIElement.OnVisualAncestorChanged(Object sender, AncestorChangedEventArgs e)
bei System.Windows.Media.Visual.ProcessAncestorChangedNotificationRecursive(DependencyObject e, AncestorChangedEventArgs args)
bei System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
bei System.Windows.Media.Visual.AddVisualChild(Visual child)
bei System.Windows.Controls.Decorator.set_Child(UIElement value)
bei EO.Wpf.WebViewHost.OnApplyTemplate()
bei System.Windows.FrameworkElement.ApplyTemplate()
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
bei System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
bei System.Windows.Controls.Grid.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Control.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
bei System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Controls.Border.MeasureOverride(Size constraint)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Window.MeasureOverrideHelper(Size constraint)
bei System.Windows.Window.MeasureOverride(Size availableSize)
bei System.Windows.FrameworkElement.MeasureCore(Size availableSize)
bei System.Windows.UIElement.Measure(Size availableSize)
bei System.Windows.Interop.HwndSource.SetLayoutSize()
bei System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
bei System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
bei System.Windows.Window.SetRootVisual()
bei System.Windows.Window.SetRootVisualAndUpdateSTC()
bei System.Windows.Window.SafeCreateWindowDuringShow()
bei System.Windows.Window.ShowHelper(Object booleanBox)
bei System.Windows.Window.Show()
eo_support
Posted: Tuesday, April 24, 2018 11:21:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,068
Hi,

This specific error occurs when the browser engine is allocating memory to load the native browser engine code. This allocation only occurs once but due to the amount of code needed for a browser engine, the memory allocation is quite large (roughly the same size as EO.WebEngine.dll). So if your application is low on memory, or even if your application has enough free memory but the memory very fragmented (thus there is no single continuous space that is large enough), the allocation will fail.

For the long term we would suggest you to treat this as just an OutOfMemoryException in your application that is pretty much the same as any other out of memory situation and we would recommend you modify your application to reduce the memory footprint in order not to run into such error because even if you somehow suppress this one, another out of memory exception can popup somewhere else.

For short term relief, you can try to create a dummy WebView immediately after your application starts. This will allocate the above memory block in the early stage of your application thus is less likely to fail. Because the allocation only occurs one time, when later you need to create your real WebView, it won't allocate again.

Hope this helps.

Thanks!



You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.