how can I enable latest versions of CefSharp/Cef to utilize more of the available memory on a computer?
Here is a test case:
I load an infinite page, like https://www.facebook.com/Google, then run a script that scrolls down the page, as I want to load as much as possible of that page.
With CefSharp/Cef 79 and earlier, I am able to scroll down to dates back in year 2010
With latest CefSharp/Cef the render process crashes when reaching some point in 2015
Here is the script:
- Code: Select all
async function wait(intervalInMilliseconds) {
return new Promise((resolve) => setInterval(resolve, intervalInMilliseconds));
}
async function unlimitedScroll() {
for (let i = 0; ; ++i) {
await window.scrollTo(0, document.body.scrollHeight);
await wait(2000);
await console.log(`Scroll: ${i}, total: ${window.performance.memory.totalJSHeapSize.toLocaleString()}, used: ${window.performance.memory.usedJSHeapSize.toLocaleString()}, limit: ${window.performance.memory.jsHeapSizeLimit.toLocaleString()}`);
}
}
unlimitedScroll();
The browser crashes around the time the totalJSHeapSize reaches 4GB - but I am running on a 32GB machine, so I have memory to spare
I tried setting values with --js-flags for the settings --max_heap_size, --max_old_space_size and --max_semi_space_size, but it does not help. As a matter of fact, setting a large value for --max_semi_space_size makes the browser crash even sooner than with the defaules.