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?

more ▼

asked Jun 22, 2010 at 01:04 PM

Daniel gravatar image

57 12 9 12

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Jun 22, 2010 at 02:41 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
10.5k 9 37 115

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.

Jun 23, 2010 at 08:31 AM jonas echterhoff ♦♦

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.

Jun 23, 2010 at 08:04 AM Daniel
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Jun 22, 2010 at 01:04 PM

Seen: 3083 times

Last Updated: Jun 22, 2010 at 01:04 PM