I've had quite a strange phenomenon with Xorg for some time now: After logging in to my laptop (specifics below) the cpu consumption of Xorg increases monotonically, even if the computer is idle and nobody sits in front of it. I measured the phenomenon over night+morning and got the following result:

up/min  cpu%
14      3.4
29      3.4
44      3.6
59      3.9
74      4.2
89      4.5
734     17.8
749     18.1
764     18.5
779     18.8
794     19.1
809     19.4

It actually continues like this regardless whether somebody (=me) uses the computer or not. If you approximate this, it is about 0.025 %/min. Do you have any clue why this happens or how I could figure this out?

Some specs:

CPU: Atom with 1.6 GHz max
Distro: Ubuntu 10.04 LTS
GUI: Gnome 2.30.2
WM: xmonad 0.9.1
X.Org X Server 1.7.6
Linux Kernel: 2.6.32-33

This is a bug, either in an application that's running on your X server, or in the X server and triggered by an application you're running, or (most likely) in your display driver.

To pinpoint the culprint, start an X server that's not running any risky application. Log out, then switch to a text console by pressing Ctrl+Alt+F1. Log in, then run sudo service gdm stop and startx xterm -e top -- :0. If the CPU load increases, then your driver is the culprit; otherwise it could be either an application making repeated requests to the X server or a bug in the X server. If you can't see any application using up CPU time, the X server is likely to be the sole culprit.

Once you've done a little bit of investigation, report the bug to your distribution. (Search first to see if someone has already reported it.) For Ubuntu, look at How do I report a bug?. Include the line in the output of lspci for your video card.

  • As starting xterm with startx seemed to cause some sort of trouble, I started it directly from gdm when logging in. This is a very nice idea, and I am experimenting with it. I'll report back if there is any success (it always takes some time to verify if the load increases or not). – bitmask Aug 1 '11 at 2:47

If the culprit is a client application, xrestop might come handy. Useful when the client leaks Xorg resources. It's a top-like application for Xorg resources.

  • xrestop is certainly a nice tool, but does not seem to indicate the cpu usage, caused by that application (there does not seem to be a memory leak, only a computation leak .. so to speak). Could you elaborate how I can figure out the client application that causes trouble with xrestop? – bitmask Aug 1 '11 at 2:41
  • 1
    If you can find some unexpected growth of the amount of resources used by a client over time, then you have a suspect (xrestop shows the pid of the process and/or X identifier). If nothing shows up, probably the issue is internal to the X server. – Stéphane Gimenez Aug 1 '11 at 10:26
  • For what it's worth, I followed this answer and used xrestop to figure out why Xorg is killing me, and it turned out xcompmgr was the reason. Killing it made the problem go away completely, in htop, Xorg has very low CPU usage now. – axel22 Jan 31 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.