7

Well I have noticed a weird bug.This occurs on resizing.

I First noticed it while I was trying to fix my xaml alignments. When I try to resize the window across my 2 screens the awesomium content was starting to flickering and suddenly content dissapeared and the redscreen with the logo came up, short after vshost32.exe crashed.

I thought well.. ok it might have some width limitations so I limited the MaxWidth of the window on Primary Screen's Width. I noticed some flickerings aswell while I was trying to resize it horizontally, but that was all, however when I spammed the resize and changed many times height and width the same issue occured on maxheight 1080 and max width 1920.

enter image description here enter image description here

Edit2 Additional information: I have 2 WebControls on the same XAML. When i added multiple, and resized... it crashed the first second.

Edit (1)

[1123/013232:INFO:(0)] WebCore is now online.
[1123/013232:INFO:(0)] Running Awesomium 1.7.5.1
[1123/013247:WARNING:Awesomium.NET(0)] System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
   at System.Windows.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette)
   at Awesomium.Windows.Controls.WebViewPresenter.Awesomium.Core.ISurface.Initialize(IWebView view, Int32 width, Int32 height)
   at Awesomium.Core.Surface.oQVs2ZKQlyYpFHm4aaM(Object , Object , Int32 width, Int32 height)
   at Awesomium.Core.Surface.InitializeDirector(IWebView view, Int32 width, Int32 height)
   at Awesomium.Core.Surface..ctor(IWebView view, Int32 width, Int32 height, ISurface surfaceImpl)
   at Awesomium.Core.SurfaceFactory.Nu5RdsobJP(IntPtr  , Int32  , Int32  )
   at Awesomium.Core.NativeMethods.WebCore_Update(HandleRef jarg1)
   at Awesomium.Core.WebCore.UpdateThunk()
[1123/013247:ERROR:ipc_channel_win.cc(261)] pipe error: 109

It seems to me that there's some meory leak here.

After 2 GBs of Wasted Ram, it gets crashed.

Tried it with 8.5 GB of Ram used, gone up to 10.5 and then crashed.

I've made some tests in order to find what is causing this error. I created a loop that it would resize the window at 2 widths and heights every 50 ms

 public async void testc() {
        for (int i = 0; i <= 1000; i++)
        {
            this.Width = 1700 + i % 2;
            this.Height = 950 + i % 2;

            await Task.Delay(50);
        }
    }

it crashed again as expected, interesting is though, that when i appended at the loop

WebControl.Reload(true);

it actually didn't crashed... Memory was going up and down from 350 MBs

Is there anyway to prevent Rendering while resizing?

user990423
  • 1,397
  • 2
  • 12
  • 32
Devian
  • 817
  • 1
  • 12
  • 22

1 Answers1

0

Think you can resize only after your control has fully initialized and displayed. IMHO bitmap

 at System.Windows.Media.Imaging.WriteableBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette palette)

is zero size or invalid.

I used Awesomium in the past, my suggestion is to migrate to CefSharp

https://cefsharp.github.io/

  • To be honest i migrated to CefSharp 2 Days ago after the several issues i faced with Awesomium. And i'm pretty happy now. I thought cefsharp would be heavier but it seems to load just fine, and is way more optimized than this abandoned project. Thank you for your time anyway. – Devian Mar 10 '16 at 13:36
  • Interesting. This happens on cefsharp also while resizing on 4k screen. – Sabri Meviş Dec 24 '18 at 13:44