LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Xorg memory leak? (https://www.linuxquestions.org/questions/linux-software-2/xorg-memory-leak-570829/)

jiml8 07-19-2007 09:02 PM

Xorg memory leak?
 
I'm running Xorg 7.2.0 on my Mandriva 2007.1 system, with beryl 0.2 and KDE 3.5.6.

This system has 2 Gigs of RAM and 1 Gig of swap. X has been up now for 5 days (since the last time I had the system shut down to add another cooling fan).

Presently, all the RAM and 662,500 KB of swap are in use.

At the present time, Xorg is occupying 1,220,530 KB of memory, and 599,108 KB of that is resident, with the balance being cache.

When I first start Xorg, it occupies under 200,000 KB of memory and over time it grows and grows and grows, though it seems to have topped out in the last day or so.

Now, this system is pretty busy. At this time, it is running VMWare with one instance of Windows 2000 up in it and Wordperfect 8. I have 7 firefox windows open, with a total of 19 tabs. I have 3 ssh sessions up, connected to 3 servers that are out there someplace. I have 3 konqueror windows open, two of them displaying PDF files. Gaim is running, as are two instances of kate, one of ncftp, one of kmplayer, gkrellm, kontact, and Apache. There are assorted other odds and ends of tools up and running as well, but I have listed all the biggies and most of the not so biggies. All this runs on a 1680x1050 10-face beryl "cube".

My video card is an nVidia 7800 GS with 256 Megs of RAM.

As busy as this system is, it strikes me as totally absurd that Xorg is occupying 1.2 gigs. I know it caches things, but this is ridiculous. I've googled and lots of people seem to have complaints about memory usage with Xorg 7.2.0, but I haven't found anything definitive about a leak.

Does anyone here have any idea how I can rein this beast in? Is there a leak? If not, is there some cache setting, or whatever, that'll bring this under control?

It is really quite annoying to have to shut down X every few days to clean things up; takes me awhile to get the system back up afterwards.

unixpgmr 07-20-2007 08:57 AM

I would try to reign in your Firefox application first. 7 windows with a total of 19 tab? You really first need to see what each application is doing to X before you an say that X has a memory leak. I am betting that Firefox is cause quite a bit of it. Try this: 1. Start X. 2. Check memory use 3. Start Firefox: no extra windows, no extra tabs and check memory usage of both. 4. Open up your 7 windows and 19 tabs in Firefox and check memory usage It would even be better if you can just do your browsing in the single window of Firefox for the stated time and keep memory usage. Good luck. I am interested in what you find, so post a reply with your results.

Mark Havel 07-20-2007 09:06 AM

It seems Linux is keen to put as many stuff as it can in the RAM, so the real question is: Do you feel the system is constantly swapping and stressing the disk drive at every single action you try to do?

If yes, then your RAM is totally filled and you'll need to look if there were not an application running constantly on your machine which has a memory leak.
As unixpgmr said, Firefox is a good candidate but it would be pretty strange since it is supposed to be another thread and as far as I know, X does not handles the X application like Java (ie a Java process such as Eclipse or Azureus appears in the process list taking a ridiculously low amount of memory while the Java process takes hundreds of MB).
If not, well, why worrying at all?

jiml8 07-20-2007 11:07 AM

Quote:

Originally Posted by unixpgmr
I would try to reign in your Firefox application first. 7 windows with a total of 19 tab? You really first need to see what each application is doing to X before you an say that X has a memory leak. I am betting that Firefox is cause quite a bit of it. Try this: 1. Start X. 2. Check memory use 3. Start Firefox: no extra windows, no extra tabs and check memory usage of both. 4. Open up your 7 windows and 19 tabs in Firefox and check memory usage It would even be better if you can just do your browsing in the single window of Firefox for the stated time and keep memory usage. Good luck. I am interested in what you find, so post a reply with your results.

Been there, done that. Firefox isn't much of the problem. By itself, firefox is taking about 417 meg presently, and that doesn't seem to be growing with time but does increase/decrease as I open and close windows and tabs. When I stop firefox (which I do by killing it so that when it restarts it will want to restore to the same state; I actually do have ongoing use for all this stuff and frequently rotate through all those windows and tabs performing certain functions) it will knock out roughly 100 megs of the Xorg usage. That usage promptly returns when I restart firefox.

studioj 07-20-2007 09:20 PM

it is certainly within the range of posibilities x has a memory leak. when xfree first switched to modular design with xfree4 it came out with a huge memory leak. but the more likely scenario is just all kinds of junk gets attributed to x. all of video ram gets attributed to x. basically all images get attributed to x even if they are run in another program. it all adds up over time until kswapd decides enough and starts kicking stuff out then it appears to stabalize. if you are not experiencing performance problems then just flow with it. or you can try to adjust /proc/sys/vm/swappiness

syg00 07-20-2007 10:08 PM

Don't know if it still works, but maybe have a look at xrestop.

jiml8 07-21-2007 11:14 PM

xrestop does not appear to be on my system.

X is now up for 7 days and is claiming 1.446 Gigs. Swap is 911.6 Megs used, leaving me with with less than 100 megs free. System performance is deteriorating due to swapping. Guess I'll have to stop/restart X.

jiml8 07-21-2007 11:40 PM

Well, I just logged out, restarted X, logged back in, and restarted my entire environment. X is now taking 362 Megs.


All times are GMT -5. The time now is 08:38 PM.