Skip to content

Add backgroundThrottling option to webPreferences - #5086

Merged
zcbenz merged 3 commits into
masterfrom
no-throttling
Apr 8, 2016
Merged

zcbenz merged 3 commits into
masterfrom
no-throttling

Conversation

@zcbenz

@zcbenz zcbenz commented Apr 8, 2016

Copy link
Copy Markdown
Contributor

Setting backgroundThrottling will disable all throttling for background pages, close #4925.

@zcbenz
zcbenz merged commit 5ff9731 into master Apr 8, 2016
@zcbenz
zcbenz deleted the no-throttling branch April 8, 2016 07:25
@bpasero

bpasero commented Apr 16, 2016

Copy link
Copy Markdown
Contributor

@zcbenz how does this compare to the power save blocker (https://github.com/electron/electron/blob/master/docs/api/power-save-blocker.md)? I am hunting down an issue in VS Code where people say that leaving it running over night causes out of memory crashes and I wonder if any of the two (throttling, app suspend) could have an impact.

@zcbenz

zcbenz commented Apr 18, 2016

Copy link
Copy Markdown
Contributor Author

@bpasero The powerSaveBlocker prevents the system from suspending the app, while backgroundThrottling prevents Chromium throttling background pages. Their main purpose are to make the app always run at full power, they might be related to high CPU usages, but not to memory usage.

The out of memory crash is usually caused by memory leaks.

@bpasero

bpasero commented Apr 18, 2016

Copy link
Copy Markdown
Contributor

@zcbenz do we know more about what it means when an application gets suspended and when this would happen? is this something the OS would do and does not depend on using Chromium or not?

We do have leaks, but many of our users complain about crashes when Code is running in the background and restoring it. The fact that background throttling changes timeouts and intervals might be causing unexpected behavior that you would not get when keeping the app running in foreground.

@zcbenz

zcbenz commented Apr 18, 2016

Copy link
Copy Markdown
Contributor Author

The app suspension is platform depended and not related to Chromium, on OS X there is an App Nap feature to freeze the process so it doesn't run at all, on other platforms I think they usually make the program run slower by allocating less CPU resources for it.

@bpasero

bpasero commented Apr 18, 2016

Copy link
Copy Markdown
Contributor

Ok thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable throttling of requestAnimationFrame

2 participants