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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Huge memory load

Post Reply
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Huge memory load

Post by salvadordf »

Hi,

Here you have several suggestions to reduce the memory usage :
https://www.briskbard.com/forum/viewtop ... 2649#p2649
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Huge memory load

Post 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.
Post Reply