-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: js bindings must be kept by browser, not by process #536
Fix: js bindings must be kept by browser, not by process #536
Conversation
@sylvain-hamel Welcome to I've had a quick look at your PR and it looks fairly solid 👍 Are you able to fix up the formatting? You'll see under the
|
I believe this PR will address the issue raised in #477 |
@jornh Looking at the |
e3e1d53
to
29e5e61
Compare
@amaitland I had accidentally inserted tabs instead of spaces. It's fixed now. However, |
@sylvain-hamel Thanks, makes the review much easier as it filters out all the changes which are just whitespace.
Thanks, That one would be my mistake 😄 |
@sylvain-hamel Thanks for the contribution, code has been merged and will be included in the next |
@amaitland Great news! When will this branch be merged into master? |
See #509 (comment) for our discussion on that topic. |
When
renderer-process-limit
is set to a low value (1) and multiple browser instances are used, all browser instances end up using the same JS binding object (the last one registered).The root cause is that the binding is kept per process (
CefAppUnmanagedWrapper
) instead of per browser instance (CefBrowserWrapper
).The fix is to move the bindings from
CefAppUnmanagedWrapper
toCefBrowserWrapper
class. I deleted theBind
method because it was no longer used.According to this comment the number of processes is a calculated value.
On our PCs we always get one process per browser instance if we use the defaut value for
renderer-process-limit
. Each process consumes at least 20 MB. Because our app may open up to 20 browser instances, we've decided to setrenderer-process-limit
to 5 to limit the memory consumed by our app.We think this bug may occur even if you don't change
renderer-process-limit
because at some point, the number of browser instances can probably exceed the calculated limit to the number of renderer processes.