I recently reinstalled Ubuntu 11.04 Natty after a massive hard drive failure.
Now, for some reason, compiz and Xorg decide it's a fun idea to start eating up my RAM and CPU - GB by GB. Starts out at normal amounts, but quickly balloons to 1-2+GB and starts using most of my CPU. This never happened before, but none of my hardware has really changed. The only difference being that I installed 11.04 cleanly, whereas before I had upgraded from 10.10.
For example: Rebooted my computer last night. Only program running is Transmission. Come back this morning - Xorg is using 1.5GB RAM and over 50% of my CPU. There is NOTHING else running or installed. I haven't activated any fancy Compiz plugins at all. What gives?
I'm running 11.04 on a 4x AMD Athlon(tm) II X4 640 Processor with 8GB RAM. I'm using the integrated ATI Radeon HD3300 GPU with the AMD Catalyst 11.5 driver - but this problem occurs with the 11.4 AND built-in fglrx drivers as well.
I can give any other logs or sysinfo if that is needed.
TL;DR Try unplugging your USB hub (and potentially other USB devices)
My Xorg did not consume a lot of CPU but within about a day that the computer was up, it bloated up to 1.2 Gigabytes of memory. The only way to correct this was a hard reboot. After trying disabling NVidia drivers, switching to cinnamon, switching to gdm and finally kicking the damn thing (that was just for me to feel better), I noticed that as I switched to a console tty ( ALT + F1 or F2, ..., F6 ) during some gdm/lightdm service restart, there were a lot of error messages scrolling down the screen. Note, that I had only switched to ALT + F1, I had not logged in yet.
The messages were reporting that my usb tv-tuner card was not properly initialised. These messages kept scrolling on and on as if the system was stuck in an infinite loop trying continuously to initialise the tv card (and of course failing every time). As expected, as soon as I disconnected the usb tv-card, the messages stopped, but to my amazement Xorg stopped inflating too. Just to make sure, I reconnected the usb tv tuner and the error messages came up, and again Xorg started gorging memory like an SUV filling up at a gas station.
But, right before the villagers (a.k.a ubuntu users) are about to smash their dysfunctional usb equipment and stone the dysfunctional usb equipment vendor, there is a sudden turn in the scenario. It is NOT actually the usb tv-card that caused all this trouble. The tv-card was only the symptom and not the source of the problem. The plot thickens...
Having used this tv-card before without an incident, I took a better look at the error message complaining about the tv-card. There was another line complaining about the usb port of the usb-hub, where I plugged in my tv-card. Hmmm, I had just bought this hub. So then I tried plugging the tv-card in a usb port directly on the motherboard. And everything worked fine! No error messages, and no Xorg bloating. So at the end the actual problem was this:
Xorg was consuming memory because of initialisation errors of a usb device (and in my book this is a serious bug). Since a lot of people report problems with Xorg in ubuntu 12.04, I suggest that you also take a look at your usb devices. My tv-card could not be initialised when plugged in my new usb-hub, and that caused the problem. Putting it in a separate usb port on the motherboard fixed the problem.
P.S. The usb-hub is most likely either linux-incompatible, or should be replaced by one that has its own power adapter instead of being powered by the computer's usb bus (see USB hub not working properly Ubuntu 12.04). My web-cam also does not work when I plug it in the hub. It does work if plugged in a usb port on the motherboard. However note that, when I plug it in the usb-hub,
dmesg
reports that the web cam is properly recognised and initialised (althoughcheese
gives me just a black image), and since there are no error messages, Xorg does not fill up the computer's memory.P.P.S. I invite the distraught villagers to gather outside one-eyed Tim's barn, to throw their dysfunctional usb-hubs in a big festive bonfire. When the fire has built up, we will throw in the usb-hub vendor too. Free beer for everyone! Mua ha ha ha ha (deep voice laughter)
:-)
If you use Compiz in Classic environment try to install Compiz Fusion Icon and select appropriate option for window manager integration ...
Default set is :
also exist option for:
Compiz includes own window manager and works better with hardware sensors, in case of using "non-wrong set" of "selected/enabled/disabled plugins/settings" in CompizConfig Settings Manager.
Metacity and Xfvm options addressed respectively to GNOME(Classic) and Xfce.
Though, in depends of choice of Compiz's configuration set and any hardware vendors it can bring very different results.
Compiz Fusion Icon just allow quickly re-enable managers, but it isn't solution, just good tester tool, in my opinion ...
From other solutions also maybe helpful using of updated lm-sensors from
http://lm-sensors.org/
due to your system was upgraded against some drivers which is not "in abreast" :)
Some drivers read data from hardware sensors with incorrect values multiply by using old sensors libraries ... e.g. doubled fan speed etc.
I had a similar issue with Kubunutu 11.10. I resolved the issue by disabling fancy effects. I also added a ppa for xorg updates (https://launchpad.net/~ubuntu-x-swat/+archive/x-updates) but that for me didn't make a difference.
My issue is probably due to the Matrox driver not being supported by 11.10, well kernel version 3.
I have the same problem but when i satt system monitor to show all proses it showed up that xorg was using half of the cpu. I have been irritated by this bug.
But in comment 8 he made it stoop with:
this worked for me to and it made xorg use only around 5-10% cpu though it didnt help on mystic cpu usage.
There is a memory leak in your xorg, it's hard to tell exactly what the issue is without you posting your xorg logs from /var/log/ and your user xorg errors in your home folder (use show hidden files to find it).
The best suggestion I can offer you is to reinstall a version of Ubuntu that works. Try first with a USB stick or CD rom and leave it running for a while. Try to find the sweet spot and stick with that.
I had Xorg going up to 60% while watching YouTube, made my desktop very hot. What happened, I had enabled desktop "compositing" (for drop shadows etc.) All I had to do was run top, then found "xcompmgr" was running, then I sent the kill signal and now Xorg is down to 3% while watching YouTube.
Maybe some compositing apps are more efficient than others, or the one I have is badly configured.
PS: I'm using Debian 9 but I think some of my configuration is outdated--this machine was originally running Crunchbang and that's how the compositing was setup.
I have found a temporary solution to this problem. I checked the
system monitor
for which program was taking too much CPU other than theXorg
. For me it wasprettier
. I killed the program by choosingend task
. Immediately the CPU usage ofXorg
decreased to normal.Killing any other programs by accident is not a problem unless you have an
update
orupgrade
command in background. Just keep killing the programs using high CPU till you find your guy. If you kill some important program by accident, just rebootUbuntu
and everything is back to normal again.