- Home /
High CPU usage in browser
I noticed high CPU usage if I'm running unity app in Firefox, not sure about other browsers. Even for very simple project (one box and one camera with very simple movement script).
I have Core 2 Duo and one of the CPUs is used up to 100% sometimes, usage jumps from 0 to 100% without any activity. Especially it going up if i'm switching to another tab (just for regular surfing). Such behaviour makes browser usage (with unity game open in one tab) very uncomfortable.
Is it possible to fix it somehow?
Answer by jonas-echterhoff · Jun 22, 2010 at 02:41 PM
There are two things you can do to change CPU load.
One is the "run in background" checkbox in the build settings. If that is checked, you should not get any CPU usage when unity is not in the front window/tab.
The other relevant setting is Application.targetFrameRate. By setting this to a lower value, you can tell Unity not to try to run at any frame rate higher then what you set here, and idle for the remaining time.
Looks like it is some problem with unity plugin for firefox. I checked IE and Chrome, they working fine.
I made some tests on multiple PCs. Problem is 100% reproducable. If unity application is opened in one tab, switching to another tab causes 100% CPU usage. It doesn't depend on "Run in background" checkbox.
I will do more tests with Application.targetFrame rate later.
Ok, this sounds like a bug. As I'm only working on the mac side of things i cannot tell you anything specific about it - it could be our bug, or it could be mozilla's, but in any case I suggest reporting it using our bug reporter.
Your answer
Follow this Question
Related Questions
Embed Web Browser into unity 4 Answers
Best Practices, GUI and Browser Zoom, Scaling 0 Answers
Best method; Multiplayer server browser/lobby? 1 Answer
Would it be possible to make an in-browser game? 2 Answers
[FIXED]Application.URL woes 1 Answer