High /etc/X11/X Memory Usage

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

High /etc/X11/X Memory Usage

Postby feretio » Feb 22nd, '14, 02:02

Hi,

I'm trying to debug or narrow down the cause of an issue and I'm looking for some thoughts on where to look. Here's the symptoms and what I've found thus far:

Since upgrading from Mageia 3 to 4 on my laptop (Thinkpad X230, 2x2core Intel i7 2.9GHz CPUs, 16GB RAM, intel X11 driver), I've had two issues that required a reboot. Upon further investigation after the second reboot, I found that /etc/X11/X (i.e. Xorg) was using 11.9GB VIRT and 9.2GB RES (or 59.3%) of memory as per htop after an uptime of 2 days. Also, a large amount of the 4GB of swap was being used which it's never done before (other than when I knowingly taxed the system). I thought that a bit high (to say the least) with what I thought was not a lot of X11 apps running. Also, and don't laugh too hard, but I still use twm as my window manager with no display manager (i.e. the system boots to a console login, I log in and run startx).

At first, I thought the culprit might have been Virtualbox and the three VM's I usually run but as it turned out, the culprit was Google Chrome. Though I usually have two Chrome windows open, each with around 20 tabs, it hasn't really changed since I upgraded from Mageia 3 which I had been using since it came out.

Basically, when I run Chrome, I can just sit there and watch the memory usage on /etc/X11/X slowly rise. I ran a few tests and the memory usage goes up on average 175MB per hour. The longest I let it run in these tests was 6 hours and X's memory usage went up by over a gigabyte before I stopped it. After I stopped it, X's memory usage stopped rising but did not really go down. The only other items running were 5 Xterms and a VM running Windows XP (1GB of RAM allocated to it).

I then copied the entire .config/google-chrome directory, plopped it on my desktop (2x4core AMD 2.3GHz CPU, 64GB RAM, nouveau X11 driver) which is still running Mageia 3 (with all the latest updates) and ran Chrome for 90 minutes. /etc/X11/X usage rose in that time but only about 65MB. I also have a LOT of X11 apps running on my desktop including 5 VM's.

I'm trying to work out any issues before upgrading my desktop to Mageia 4 so any thoughts on what I should check would be awesome.

Even though Chrome is the catalyst, I'm still leaning towards a memory leak with X and I'd like to gather more information (and, probably more importantly, see if anyone else has seen a similar issue) before.

For reference:

Code: Select all
laptop$ rpm -qf /usr/bin/Xorg
x11-server-xorg-1.14.5-2.mga4

desktop$ rpm -qf /usr/bin/Xorg
x11-server-xorg-1.13.4-2.3.mga3


Thanks!

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: High /etc/X11/X Memory Usage

Postby doktor5000 » Feb 22nd, '14, 02:24

One thing that comes to mind that may help diagnosing is xrestop.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: High /etc/X11/X Memory Usage

Postby feretio » Feb 22nd, '14, 05:00

Hi Dok,

I was initially impressed by xrestop (one of the few *top programs I haven't heard of) but it doesn't seem to provide much useful information in this case. Also, an update to Chrome 33.0.1750.117 came out today but there wasn't any change in X's memory usage.

At 17:43, I started Chrome 33.0.1750.117:

Code: Select all
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3678 root       20   0 1449M 1271M 17400 S  6.0  8.1 26:45.34 /etc/X11/X :0 -ignoreABI vt1 -auth /home/myhome/.serverauth.3653 -deferglyphs 16

res-base Wins  GCs Fnts Pxms Misc   Pxm mem  Other   Total   PID Identifier
2a00000   106   45    1  176  407    14310K     14K  14324K 15284 Google Chrome
1c00000    10    2    1    4   22     5960K      1K   5962K 30305 Microsoft Windows XP (Snapshot 2)


At 19:01:
Code: Select all
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3678 root       20   0 1593M 1413M 37196 R 11.2  9.0 32:21.43 /etc/X11/X :0 -ignoreABI vt1 -auth /home/myhome/.serverauth.3653 -deferglyphs 16


At 19:47:
Code: Select all
  PID USER      PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command
 3678 root       20   0 1723M 1522M 65608 S 11.8  9.7 35:50.61 /etc/X11/X :0 -ignoreABI vt1 -auth /home/myhome/.serverauth.3653 -deferglyphs 16

res-base Wins  GCs Fnts Pxms Misc   Pxm mem  Other   Total   PID Identifier
00000   142   49    1  726 1180     9630K     33K   9663K 15284 Google Chrome


htop shows an increase of about 274MB of memory (and still growing) but xrestop actually dropped by about 15MB and held steady.

I'm thinking of trying an older version of Chrome (I've been collecting the rpm's every time I updated) and thought about using strace but 1) I'm not sure how to use it on X and 2) running it on Chrome will likely yield too much information to be useful.

Any other thoughts?

Thanks!

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: High /etc/X11/X Memory Usage

Postby doktor5000 » Feb 22nd, '14, 13:04

feretio wrote:I was initially impressed by xrestop (one of the few *top programs I haven't heard of) but it doesn't seem to provide much useful information in this case.


Yes, same here. It may be useful if some programs allocate a lot of ressources inside X (pixmaps ...) but for a memory leak in general not that helpful, but may provide hints.

A few more pointers:

- try chromium-browser from Mageia repos, as it's compiled completely different than Chrome it may yield different results, but I suspect it won't help
- try a different graphics driver (if available, you can also try vesa or fbdev for comparison)
- try changing the way you start X. startx is not supported anymore. Better use xinit to run TWM or at least try to run some other desktop environment.
this is what X looks like here when started automatically:
root 1052 3.7 2.0 259772 83860 tty2 Rs+ Feb12 564:37 /etc/X11/X :0 vt2 -nolisten tcp -auth /var/run/xauth/A:0-VjFbyb

- run chrome via google-chrome --purge-memory-button
-> you should get a button in Chrome to purge memory
- disable Flash plugin in Chrome
- have a look at the following links for related information
http://askubuntu.com/questions/158141/f ... emory-leak
http://unix.stackexchange.com/questions ... mory-leaks
http://superuser.com/questions/410311/m ... gle-chrome
https://productforums.google.com/forum/ ... SydCScdDho
http://code.google.com/p/chromium/issue ... ?id=127760

- google for "chrome memory leak linux" -> a lot of results show up there
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18018
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: High /etc/X11/X Memory Usage

Postby jiml8 » Feb 22nd, '14, 21:23

I don't know about Mageia 4, but in Mageia 3 the X memory leak is associated with Flashplayer. The magnitude of the leak seems to vary with the version of Flashplayer, but it is always there. Presently, I have not restarted X for almost 4 days, and X is taking 750 Meg, vs about 45 Meg after a restart.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: High /etc/X11/X Memory Usage

Postby feretio » Feb 24th, '14, 05:40

Thanks for all the great tips and fodder to continue debugging. I'll post back shortly with some results.

Thanks!

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: High /etc/X11/X Memory Usage

Postby feretio » Feb 26th, '14, 02:20

Update:

I read through much of the links graciously provided but haven't really found much to go on.

Interestingly, after I did this a few days ago:

    - copied the .config/google-chrome directory from my Mageia 4 laptop to my Mageia 3 desktop
    - ran chrome for a bit resulting in the aforementioned report of some memory increase but not much. I only ran it for 90 minutes
    - restored the original .config/google-chrome directory to my Mageia 3 desktop
    - ran chrome

Since then, /etc/X11/X memory usage rose by 4GB!

On my laptop, I closed all but 14 tabs and shrunk chrome to one window instead of two. I also disabled flash and the two chrome apps to no avail. However, once I restarted X and reran chrome with that config, X didn't seem to be growing any longer. I re-enabled flash and so far, still little to no growth. I'm going to let it run for a bit longer and report again later. I'd like to suspect one of the chrome apps or one of the apps I closed but I'm not sure (e.g. why did I need to restart X to see no further growth while restarting just chrome did nothing to stop it?). It's all very odd.

-Jeff
I also tried disabling flash and the recent chrome apps I installed (HTTPS Everywhere & PushBullet) along with restarting chrome a few times but the desktop X still seems to be rising. I have yet to restart X though.
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40

Re: High /etc/X11/X Memory Usage

Postby feretio » Mar 1st, '14, 18:40

Update:

I turned up the logging on chrome (added --enable-logging --v=1) and while poking through the log, I saw a bunch of these messages:

Code: Select all
[10048:10103:0228/063308:VERBOSE1:resource_loader.cc(304)] OnResponseStarted: https://s.yimg.com/zz/combo?nq/s/mail/ui/searchads/cap_54_4390.js&nq/s/mail/ui/searchads/searchads_54_4390.js
[10048:10103:0228/063308:VERBOSE1:resource_loader.cc(608)] ResponseCompleted: https://s.yimg.com/zz/combo?nq/s/mail/ui/searchads/cap_54_4390.js&nq/s/mail/ui/searchads/searchads_54_4390.js


While I'm not exactly sure what these were doing, they were clearly attempts to load ads. Interestingly, I have AdBlock and Adblock Plus installed. Based on the 14 tabs I had open, I took a chance and closed the one with my Yahoo mail. I chose this as I've been seening a lot of wonkiness from Yahoo since they "updated" their interface (much to many people's chagrin). Since I closed that one tab, X11's memory usage has stayed the same even though I've opened and closed various other tabs (i.e., somewhat normal usage) and I haven't seen any of those messages in the chrome logs.

I still have yet to restart both chrome and X11 to see if Yahoo mail was somehow truly the culprit and I also have further poking around on my Mageia 3 desktop as X11 on there continues to rise though I have no tabs open to any Yahoo sites.

-Jeff
feretio
 
Posts: 14
Joined: May 31st, '12, 16:40


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest