Page 1 of 1

Re: Huge memory load

Posted: Mon Feb 04, 2019 1:19 pm
by salvadordf
Hi,

Here you have several suggestions to reduce the memory usage :
https://www.briskbard.com/forum/viewtop ... 2649#p2649

Re: Huge memory load

Posted: Tue Feb 05, 2019 10:24 am
by salvadordf
nazar wrote: Tue Feb 05, 2019 9:25 amWhich way of implementation is safer build-in in the application or SubProcess?
Both are equally safe using Delphi.

If we were using C++ instead of Delphi then you would be able to use the "sandbox" feature when you use the same EXE for all the subprocesses but as far as I know, Delphi can't link cef_sandbox.lib so we can't use that feature.

You should decide if you use the same or a different EXE depending on your app initialization. If it's already too complicated and you don't mind having subprocesses with a different name then perhaps you should use it.

I haven't done any tests but I guess using a different EXE for the subprocesses should use slightly less memory because it's a smaller EXE.
It could also have a faster process creation if you skip all the initialization from the main EXE.
nazar wrote: Tue Feb 05, 2019 9:25 amWhat kind of problems I could expect if I will use chromium as SubProcess?
Using a different EXE for the subprocesses requires to set the GlobalCEFApp.BrowserSubprocessPath property in the main EXE and copying the other GlobalCEFApp properties in the subprocess DPR. The rest of the code in your application is exactly the same.

As you probably know, applications built with Delphi have a curse with some antivirus programs. If you search in the forum you will find that some users reported that the subprocess EXE gives a false positive. All you can do to try to avoid it is :
  • Sign all your EXEs. Some antivirus programs seem to trust the signed executables.
  • Ask the antivirus creator to whitelist your app.
  • Tell your client to add your app to the whitelist locally.