Loading very large pages in Cef

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Loading very large pages in Cef

Postby jogy » Mon Apr 05, 2021 10:47 am

Hello,

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.
jogy
Newbie
 
Posts: 7
Joined: Mon Mar 22, 2021 7:19 pm

Re: Loading very large pages in Cef

Postby magreenblatt » Mon Apr 05, 2021 10:58 am

You already asked this question in viewtopic.php?f=6&t=18306. Please use the same thread.
magreenblatt
Site Admin
 
Posts: 10832
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 15 guests