When using my delphi app, that uses CEF4Delphi, from time to time i notice a "ghost" process in task manager.
Let's say my application is seen ad MyProject.exe, anyway from time to time another MyProject.exe appears in task manager and there is no a corresponding UI.
i already noticed in past that in case of some error there is a multiplication of "fake" processes.
I think this is linked to CEF4Delphi, could you please provide me a pointer to further study the problem?
Thanks!
Bye!
Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
Possible reason of "ghost" process
-
- Posts: 22
- Joined: Tue Nov 09, 2021 9:08 am
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Possible reason of "ghost" process
Hi,
Chromium uses several processes to handle several tasks more safely. Read this document for all the details :
https://www.chromium.org/developers/design-documents/multi-process-architecture/
When you run any web browser based in Chromium you will see several processes with the same name in the task manager but if you use the Process explorer utility found in the Sysinternals package you will also see several subprocesses running with several command line switches.
https://docs.microsoft.com/en-us/sysinternals/
However, all those processes should stop when the user closes the application. If you see them running after that then check that the application follows all the destruction steps described in the demo you used as a template for your app.
Chromium uses several processes to handle several tasks more safely. Read this document for all the details :
https://www.chromium.org/developers/design-documents/multi-process-architecture/
When you run any web browser based in Chromium you will see several processes with the same name in the task manager but if you use the Process explorer utility found in the Sysinternals package you will also see several subprocesses running with several command line switches.
https://docs.microsoft.com/en-us/sysinternals/
However, all those processes should stop when the user closes the application. If you see them running after that then check that the application follows all the destruction steps described in the demo you used as a template for your app.
-
- Posts: 22
- Joined: Tue Nov 09, 2021 9:08 am
Re: Possible reason of "ghost" process
Hi, thanks for the reply.
I am using sub process by defining in my project "MyProject.exe":
GlobalCEFApp.BrowserSubprocessPath := 'SimpleBrowser_sp.exe'
as a consequence i see multiple instances of 'SimpleBrowser_sp.exe' in task manager and this is fine, the problem is that sometimes i see also multiple Instances of "MyProject.exe" too, and some of those consume low memory, like if they are "sleeping"; i did not run those instances manually, of course if i run more instances of my exe i will see more entries in task manager, but those appear without me running them, what could be the reason?
Thanks!
I am using sub process by defining in my project "MyProject.exe":
GlobalCEFApp.BrowserSubprocessPath := 'SimpleBrowser_sp.exe'
as a consequence i see multiple instances of 'SimpleBrowser_sp.exe' in task manager and this is fine, the problem is that sometimes i see also multiple Instances of "MyProject.exe" too, and some of those consume low memory, like if they are "sleeping"; i did not run those instances manually, of course if i run more instances of my exe i will see more entries in task manager, but those appear without me running them, what could be the reason?
Thanks!
- salvadordf
- Posts: 4580
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Possible reason of "ghost" process
Those processes might be previous executions of the main application EXE.
Run your application inside the Delphi debugger and see if GlobalCEFApp doesn't freeze when it's destroyed.
If you see that happening then check that all the steps in the destruction sequence are implemented.
All web browsers should be correctly destroyed before trying to close the application.
Run your application inside the Delphi debugger and see if GlobalCEFApp doesn't freeze when it's destroyed.
If you see that happening then check that all the steps in the destruction sequence are implemented.
All web browsers should be correctly destroyed before trying to close the application.