[Xquartz-dev] xquarz uses 100% of CPU when not focused

Gene Selkov selkovjr at gmail.com
Mon Feb 9 10:56:27 PST 2009


Here's another data point, if I may say so. I feel uneasy calling this
information "data", or even "information", for that matter.
Information, after all, is defined as a measure of decrease in
uncertainty. In that sense, I'll be
happy if it's not misinformation.

This is as clean an experiment as I could manage today.

After I sent my earlier observation involving gimp, I have rebooted
the machine and started X11 with one bare, undecorated xterm (gimp is
too complicated and may have problems of its own -- although it works
flawlessly on my linux machine). I used that xterm for a few minutes
to read email at work, then launched an ssh with a vnc tunnel to
another machine and left it alone for a while. Worked in VNC for a few
minutes and quit. Then for a longer while, all I had on my screen was
that (idle) xterm window, a firefox window, and Activity Monitor. I
didn't touch the machine for several hours, but I was in the same room
and would have heard the fan turn on if it were up to something. It
wasn't. Then I opened gmail in that firefox window to check this
thread and instantly -- I mean, in seconds -- the fan turns on, and
sure enough, it is X11. No quartz-wm, no any-wm, no other clients.

The prior report fully confirmed.

If it is, indeed, a queue problem, then it probably has to do with the
kind of stuff thrown in it, rather than quantity, or perhaps the queue
itself is broken. Unlike in my first experiment, where I consciously
tried to stress it, this time I almost didn't touch it. Not with my
hands, anyway. Maybe there is something invisible taking place.

An interesting thing, probably not related, is how that load is
balanced among the two CPUs. I let it spin for a while without
touching the inputs, staring at the Activity Monitor. Typically, it
uses one CPU with the other being completely idle. Then, in a few
minutes, it gradually moves from to the other CPU. Or, at least,
Activity Monitor shows the transition as gradual (maybe it smoothes
the graph). Then, without any disturbance from the outside, it
suddenly migrates back. So it goes back and forth in a somewhat random
pattern. Once during about 5 minues, I saw it loading both CPUs
equally, at 50% each, before finally taking over one and releasing the
other.

I realize that scheduling is many architecture layers down from X11,
but I'm irrationally curious to see how this would play out on a
snigle-CPU system, if such exist.

--Gene


More information about the Xquartz-dev mailing list