CEF/CEFSharp usage

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

CEF/CEFSharp usage

Postby Egle » Fri Dec 18, 2020 4:21 am

Hi, I' m a software engineer and I have a big problem that I wanted to know if or how to solve it. I was forced to use version 75 by my corporate, and I compiled CEF branch 3770 with .mp4 support with success. I have my renderer WindowsForm with CefSharp and recompiled CEF working. Info : Version Info - CefSharpVersion: 75.1.143.0, CefVersion: r75.1.14+gc81164e+chromium-75.0.3770.100, ChromiumVersion: 75.0.3770.100. Our application runs and must also run on somewhat obsolete machines, let's say, however most 32-bit windows 7 and with no more than 8 gigabytes of RAM, so we have sentinels on the use of memory resources, CPU, etc. At the Threshold we kill the most expensive processes. But one of the CefSharp.BrowserSubprocess.exe increases memory usage and never releases it while browsing until the crash. What are the methods to avoid it.
I trust in your help, ask me for all the technical details you need.

Thanks, best regards
Egle Mirabile
Egle
Newbie
 
Posts: 6
Joined: Thu Nov 26, 2020 6:12 am

Re: CEF/CEFSharp usage

Postby amaitland » Fri Dec 18, 2020 5:13 am

  1. Is the process crashing or is it being terminated by your sentinel?
  2. What is the memory limit you are imposing?
  3. What type of process is crashing? (Each sub process has a --type command line arg you can view in task Manager)
  4. Are you using CefSharp as a general web browser or hosting an application specifically?
  5. If you are using it is a general web browser then using such an old version is a huge security risk.

  1. If your application is x86 it's important that you make it LargeAddressAware see https://github.com/cefsharp/CefSharp/wi ... -of-memory
  2. Enable Crash Reporting and get a dump,
  3. Read https://developers.google.com/web/tools ... y-problems and profile the javascript

I'd strongly advice you make a case for upgrading to a newer supported version.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am

Re: CEF/CEFSharp usage

Postby Egle » Fri Dec 18, 2020 12:03 pm

Thanks for the reply,
The parent process, the renderer is killed and restarted because one of its child processes CefSharp.BrowserSubprocess.exe, reaching the threshold of
<add key="RamThreshold" value="400000" /> <!-- RamThreshold is express in Kb --> the limit is reached in less than an hour.
The renderer must be active 24/24 on ATM, and navigate on HTML predefinited screens.
After I have implemented the suggested fix for LargeAddressAware (the application is x86) memory consumption has dropped significantly, but random crashes are now occurring and I report stack traces:

System.Runtime.InteropServices.SEHException was unhandled
ErrorCode=-2147467259
HResult=-2147467259
Message=External component has thrown an exception.
Source=CefSharp.BrowserSubprocess.Core
StackTrace:
at CefExecuteProcess(CefMainArgs* , scoped_refptr<CefApp>* , Void* )
at CefSharp.BrowserSubprocess.SubProcess.Run() in c:\projects\cefsharp\cefsharp.browsersubprocess.core\subprocess.h:line 56
at CefSharp.BrowserSubprocess.Program.Main(String[] args) in C:\projects\cefsharp\CefSharp.BrowserSubprocess\Program.cs:line 52
InnerException:

Event Viewer
Faulting application name: CefSharp.BrowserSubprocess.exe, version: 75.1.143.0, time stamp: 0x5dbe3f08
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17514, time stamp: 0x4ce7b8f0
Exception code: 0xe0000008
Fault offset: 0x0000b760
Faulting process id: 0x80c
Faulting application start time: 0x01d6d54a20ba10e6
Faulting application path: R:\BIN\CefSharp.BrowserSubprocess.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 031da3a1-4141-11eb-a99b-080027500cd0

Application: CefSharp.BrowserSubprocess.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Runtime.InteropServices.SEHException
at <Module>.CefExecuteProcess(CefMainArgs*, scoped_refptr<CefApp>*, Void*)
at CefSharp.BrowserSubprocess.SubProcess.Run()
at CefSharp.BrowserSubprocess.Program.Main(System.String[])
Egle
Newbie
 
Posts: 6
Joined: Thu Nov 26, 2020 6:12 am

Re: CEF/CEFSharp usage

Postby amaitland » Fri Dec 18, 2020 2:30 pm

Enable crash reporting, get a dump, download libcef.dll.pdb and analyze the crash.
https://github.com/cefsharp/CefSharp/wi ... -diagnosis

You'll need to profile your JavaScript and fix any memory leaks.

So your memory limit is approx 390mb? That's too low to run any chromium based browser, specially 24/7 usage.

You can use https://github.com/cefsharp/CefSharp.MinimalExample to test out version 86, I'd suggest testing and seeing if the crash you are seeing is resolved.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 14 guests