Need more control of garbage collection

Think CEF could benefit from a new feature or capability? Discuss CEF feature requests here.

Need more control of garbage collection

Postby talbot » Thu Oct 30, 2014 10:10 am

We have a memory intensive web application and V8's Javascript Garbage Collection frequency is proving to be too relaxed for our needs. We can watch the memory in the Timeline (on Dev Tools) grow as we perform memory intensive DOM operations in Javascript, however it can take several minutes for large sets of memory (50+ MB) to be garbage collected. There is no leak, we always return back to baseline memory eventually and we can expedite that by pressing the "Collect Garbage" button on the Dev Tools.

The real problem is that our application is so memory intensive that users can push it beyond it's 1.2GB process memory limit which leads to crashing the render process.

I have tried many of the javascript flags to tweak GC, but none provided satisfactory results.

Is there a way to adjust the garbage collector to become more aggressive, or failing that we could setup a monitor thread in our host application to monitor memory on the render process and trigger whatever method the "Collect Garbage" button triggers in the Dev Tools. We have tried exposing "window.gc()" which seems to help a bit, but does not appear to be as aggressive as clicking the "Collect Garbage" button. Is there a way to access the method that this button calls?

We are using CefGlue.
talbot
Newbie
 
Posts: 3
Joined: Thu Oct 30, 2014 10:07 am

Re: Need more control of garbage collection

Postby magreenblatt » Thu Oct 30, 2014 1:37 pm

It sounds like you've tried all of the available options.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Need more control of garbage collection

Postby talbot » Thu Oct 30, 2014 1:58 pm

Not all yet. My next step is to build a custom chromium libcef.dll in which I modify the garbage collection code myself. I was hoping there would be an easier way.
talbot
Newbie
 
Posts: 3
Joined: Thu Oct 30, 2014 10:07 am

Re: Need more control of garbage collection

Postby talbot » Thu Oct 30, 2014 2:45 pm

Getting a little traction in their forum https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/ayLU6JFqA1w Check for updates!
talbot
Newbie
 
Posts: 3
Joined: Thu Oct 30, 2014 10:07 am


Return to Feature Request Forum

Who is online

Users browsing this forum: No registered users and 15 guests