High CPU usage with tabs and GTK

Neil Whelchel neilwhelchel at gmail.com
Fri Feb 24 23:40:12 PST 2012


Hello,
I am working with a pygtk program that draws various forms for data input.
Any time that I use tabs, I end up with 100% CPU usage. As soon as I remove
the tabs, the CPU returns to idle. I did some research on the 'net and I
found a number of people complaining about slow rendering when tabs are
involved, however I think this might not be related. There seems to be no
noticeable effect on the speed of the application, it does not seem slow
when changing tabs, and all except for gtk.events_pending() never returning
false when any tabs are on the screen, it works as expected. I ran strace
on the app, and there is a huge amount of repeating chatter (below) between
X and the app over the socket when ever tabs are used. From the python end,
things are idle, so the chatter is likely generated somewhere within the
gtk main loop. gtk.pygtk_version(2, 24, 0) gtk.gtk_version(2, 24, 6)
X -version
X.Org X Server 1.10.4
Release Date: 2011-08-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.24-29-server x86_64 Ubuntu
NVIDIA-Linux-x86_64-295.20

I was able to re-produce the problem with an older computer running the
same versions of the above except that it is a 32 bit Intel and the Nvidia
driver is 96.43.20.

Here is a cut and paste of what strace shows, the messages repeat about 90
times per second when tabs are active.
...
[pid 17723] writev(6, [{"5
\4\0000\"`\5.\"`\5\7\0\1\0H\2\r\0000\"`\5\10\0`\5\7\0\1\0"..., 244}, {NULL,
0}, {"", 0}], 3) = 244
[pid 17723] poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6,
revents=POLLIN}])
[pid 17723] read(6, "\1
\226\226\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
4096) = 816
[pid 17723] read(6, 0x1e3a6c4, 4096)    = -1 EAGAIN (Resource temporarily
unavailable)
[pid 17723] read(6, 0x1e3a6c4, 4096)    = -1 EAGAIN (Resource temporarily
unavailable)
[pid 17723] poll([{fd=6, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=6,
revents=POLLOUT}])
[pid 17723] writev(6, [{"5
\4\0004\"`\0052\"`\5\2\0\1\0H\2\10\0004\"`\5\10\0`\5\2\0\1\0"..., 224},
{NULL, 0}, {"", 0}], 3) = 224
[pid 17723] poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6,
revents=POLLIN}])
[pid 17723] read(6, "\1
\241\226\304\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
4096) = 816
[pid 17723] read(6, 0x1e3a6c4, 4096)    = -1 EAGAIN (Resource temporarily
unavailable)
[pid 17723] read(6, 0x1e3a6c4, 4096)    = -1 EAGAIN (Resource temporarily
unavailable)
[pid 17723] poll([{fd=6, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=6,
revents=POLLOUT}])
...

Fd 6 is the socket as described below:
socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 6
connect(6, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0

Thanks in advance for any suggestions,
-Neil-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg/attachments/20120224/1fe8e472/attachment.html>


More information about the xorg mailing list