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.
Optimization
Optimization
Hi!
What can be disabled to make the browser consume a minimum of resources?
What can be disabled to make the browser consume a minimum of resources?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Optimization
Hi,
Try disabling everything you don't really use. In that list you could have JavaScript, images, plugins, webgl, etc.
Many of those options can be disabled in TChromium.Options.
There are several GlobalCEFApp properties that might affect RAM usage.
Try disabling GlobalCEFApp.FlashEnabled, GlobalCEFApp.EnableMediaStream or GlobalCEFApp.EnableSpeechInput.
If you don't want to use too much RAM then specify a GlobalCEFApp.cache directory.
If you enable GlobalCEFApp.EnableGPU you might see lower CPU usage but it could cause problems with some unsupported graphics cards.
It would be interesting to compare the RAM usage between TChromium in normal mode and off-screen mode (OSR) with a reduced virtual screen size.
I'm probably forgetting more features you can disable...
Try disabling everything you don't really use. In that list you could have JavaScript, images, plugins, webgl, etc.
Many of those options can be disabled in TChromium.Options.
There are several GlobalCEFApp properties that might affect RAM usage.
Try disabling GlobalCEFApp.FlashEnabled, GlobalCEFApp.EnableMediaStream or GlobalCEFApp.EnableSpeechInput.
If you don't want to use too much RAM then specify a GlobalCEFApp.cache directory.
If you enable GlobalCEFApp.EnableGPU you might see lower CPU usage but it could cause problems with some unsupported graphics cards.
It would be interesting to compare the RAM usage between TChromium in normal mode and off-screen mode (OSR) with a reduced virtual screen size.
I'm probably forgetting more features you can disable...

Re: Optimization
If not a disk cache to clear, maybe there's a way to release memory?
If you call..
CloseBrowser (True);
You can delete\clear the cache, but how to resume work?
If you call..
CloseBrowser (True);
You can delete\clear the cache, but how to resume work?
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Optimization
The number of processes, cache handling and other memory management is done internally in Chromium.
All you can do is destroy browsers that are no longer used and wait until Chromium frees all their associated resources.
All you can do is destroy browsers that are no longer used and wait until Chromium frees all their associated resources.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Optimization
Depends on your definition of "resume work". You can create a new browser with the same request context and your cookies and cache will be reused.dilfich wrote: Tue Jun 12, 2018 9:13 am If you call..
CloseBrowser (True);
You can delete\clear the cache, but how to resume work?
Re: Optimization
Yes, I do. But there is another problem, why not all memory is freed?salvadordf wrote: Tue Jun 12, 2018 9:27 am Depends on your definition of "resume work". You can create a new browser with the same request context and your cookies and cache will be reused.

- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Optimization
I don't know.
I don't work at Google and I'm not a part of the Chromium project. I don't know why the Chromium developers decided to do that.

I don't work at Google and I'm not a part of the Chromium project. I don't know why the Chromium developers decided to do that.
Re: Optimization
And how can I display the memory occupied by the application when there are many processes?
For example, this method does not work..
For example, this method does not work..
function CurrentProcessMemory: Cardinal;
var
MemCounters: TProcessMemoryCounters;
begin
Result := 0;
MemCounters.cb := SizeOf(MemCounters);
if GetProcessMemoryInfo(GetCurrentProcess,
@MemCounters,
SizeOf(MemCounters)) then
Result := MemCounters.WorkingSetSize
else
RaiseLastOSError;
end;
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Optimization
I quick google search shows these possible methods to get the memory usage :
https://stackoverflow.com/questions/437 ... hi-program
http://www.swissdelphicenter.com/en/sho ... hp?id=2276
https://stackoverflow.com/questions/437 ... hi-program
http://www.swissdelphicenter.com/en/sho ... hp?id=2276
Re: Optimization
Or maybe CloseBrowser is not enough and you need something else to call?salvadordf wrote: Tue Jun 12, 2018 9:40 am I don't know.![]()
I don't work at Google and I'm not a part of the Chromium project. I don't know why the Chromium developers decided to do that.