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.