The GNU of Life, the Universe and Everything

January 3, 2010

how to fix firefox hanging every few seconds

Filed under: linux — Tags: , , , , , , — Pedro Carvalho @ 5:25 am

Every x seconds, my firefox (built from sources) hangs for a few seconds (but the other applications keep running smothly).

Seems that my firefox (i didn’t tried using the binary) isn’t very keen on multithreading.
By default it has:

$ taskset -c -p firefoxpid
pid 29964's current affinity list: 0,1

To find firefox’s pid do:

$ ps -eo pid,comm | grep firefox
29964 firefox

So, firefoxpid is 29964, only in this case (pid varies). I needed to do this:

taskset -c -p 0 29964

with -c 0 (<– that’s a zero) the affinity mask is set to 1, so firefox only is allowed to use one cpu.
Take note of the parameters ordering: first the flags ( -c -p ) them the values ( <affinity list> <pid> )

the cpu id:
$ taskset -c -p firefoxpid
pid 29964's current affinity list: 0

the number of cpu’s allowed:
$ taskset -p firefoxpid
pid 29964's current affinity mask: 1

If firefox is to start from the beginning restricted,  it can be launched like:

taskset -c 0 firefox

That should lessen the hangings. In my case, javascript still hanged a bit.

About these ads

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: