2

I have used CEF4Delphi to embed CEF / Chromium in my Delphi XE 10.1 application. I am currently at CEF Version 3.2987.1597.gffc5773 (Chromium Version 57.0.2987.110), 32 bit.

I can see the render process in the Windows Task Manager normally staying at 0% CPU usage when customers are not browsing, but then sometimes the render process seems to get stuck and grabs all the CPU it can get (100% of a single CPU, 16% of total since I have 6 available), even when the user is doing nothing and the browser window is not visible. When stuck it seems to remain stuck until I end the process, several hours has been observed. I have turned on verbose logging but nothing gets logged as long as the user is not doing anything. I do get lots of logging at startup and when the user is actively browsing.

Any tips on how to resolve this? I only see this issue on my Terminal Server and have not been able to reproduce the behaviour myself either on dev machines or the TS. Last time I saw this behaviour was about two hours after start up of the application.

Any help appreciated.

Thanks, Sjur

Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
sjur
  • 53
  • 1
  • 4
  • Upstream cefclient does a trick when window is minimized it sets browser window size to 0x0 to reduce resource usage. Maybe this could help you see example code here: https://github.com/cztomczak/phpdesktop/issues/179 – Czarek Tomczak Apr 12 '17 at 10:39
  • Thanks, I tried this but window size has no effect. Still runs at 100% CPU. I have reproduced the problem from time to time on my dev machine as well now, but still unable to locate the problem. – sjur May 09 '17 at 07:31

1 Answers1

0

Sorry for the late answer.

Close your app and clear the cache and cookies directories.

  • Thanks, but my users don't experience any problems so they just leave the app hanging. What I have currently done is monitoring the CPU usage of every render process and terminate the ones having high CPU usage after the browser window have been hidden. When been brought visible again i fire refresh() and the main chrome process starts a new render process. This seems to work, but there should be a better solution... – sjur Aug 02 '17 at 12:51
  • 1
    Sorry for replying so late. There was an issue releasing the browsers in the first CEF4Delphi versions that left a browser subprocess working when you closed the application. The latest CEF4Delphi version doesn't have that issue. Please, download CEF4Delphi again and use one of the demos as a template for your apps. – Salvador Díaz Fau Dec 20 '18 at 13:53