Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
X is consuming massive memory
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Thu May 30, 2013 3:53 pm    Post subject: X is consuming massive memory Reply with quote

I've been having performance issues on my system recently, slow window switching and just now I got an error emerging world:

Quote:
OSError: [Errno 12] Cannot allocate memory


Investigating the memory issue, it seems that the primary culprit is X:

Quote:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 3644 1.3 72.1 18628156 11848148 tty7 Ss+ May15 294:41 \_ /usr/bin/X -br -novtswitch -quiet :0 vt7 -nolisten tcp -auth /var/run/xauth/A:
0-nbMQVb


It seems to be consuming 72.1% of my 16GB memory. ...and this is after stopping all major running programs: firefox, chromium, thunderbird, etc.

A glance at /var/log/Xorg.0.log seems to indicate some suspicious behavior:

Quote:

[ 2984.880] [mi] Increasing EQ size to 512 to prevent dropped events.
[ 2984.880] [mi] EQ processing has resumed after 223 dropped events.
[ 2984.880] [mi] This may be caused my a misbehaving driver monopolizing the server's resources.
(EE) [mi] EQ overflowing. Additional events will be discarded until existing events are processed.
(EE)
(EE) Backtrace:
(EE) 0: /usr/bin/X (xorg_backtrace+0x36) [0x59b206]
(EE) 1: /usr/bin/X (mieqEnqueue+0x273) [0x57ba43]
(EE) 2: /usr/bin/X (0x400000+0x4eece) [0x44eece]
(EE) 3: /usr/lib/xorg/modules/input/evdev_drv.so (0x7f6af159b000+0x6329) [0x7f6af15a1329]
(EE) 4: /usr/bin/X (0x400000+0x79a47) [0x479a47]
(EE) 5: /usr/bin/X (0x400000+0xa50c5) [0x4a50c5]
(EE) 6: /lib64/libpthread.so.0 (0x7f6af7b1c000+0x10460) [0x7f6af7b2c460]
(EE) 7: /usr/lib/xorg/modules/drivers/nvidia_drv.so (0x7f6af1eb0000+0xf4f4f) [0x7f6af1fa4f4f]
(EE) 8: /usr/lib64/libpixman-1.so.0 (0x7f6af7670000+0x1133a) [0x7f6af768133a]
(EE) 9: /usr/lib64/libpixman-1.so.0 (0x7f6af7670000+0x1819a) [0x7f6af768819a]
(EE) 10: /usr/lib64/libpixman-1.so.0 (0x7f6af7670000+0x1828a) [0x7f6af768828a]
(EE) 11: /usr/lib64/libpixman-1.so.0 (0x7f6af7670000+0x542c5) [0x7f6af76c42c5]
(EE) 12: /usr/lib64/libpixman-1.so.0 (pixman_image_composite32+0x4c4) [0x7f6af767ba44]
(EE) 13: /usr/lib/xorg/modules/libwfb.so (wfbComposite+0x1d8) [0x7f6af1ca2428]
(EE) 14: /usr/lib/xorg/modules/drivers/nvidia_drv.so (0x7f6af1eb0000+0x5392d7) [0x7f6af23e92d7]
(EE) 15: /usr/bin/X (0x400000+0x11ee33) [0x51ee33]
(EE) 16: /usr/bin/X (0x400000+0xce16d) [0x4ce16d]
(EE) 17: /usr/bin/X (0x400000+0xcf047) [0x4cf047]
(EE) 18: /usr/bin/X (0x400000+0xcd934) [0x4cd934]
(EE) 19: /usr/bin/X (0x400000+0x646ae) [0x4646ae]
(EE) 20: /usr/bin/X (MapWindow+0x15b) [0x46746b]
(EE) 21: /usr/bin/X (0x400000+0x34230) [0x434230]
(EE) 22: /usr/bin/X (0x400000+0x39ce1) [0x439ce1]
(EE) 23: /usr/bin/X (0x400000+0x283ca) [0x4283ca]
(EE) 24: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x7f6af679e4bd]
(EE) 25: /usr/bin/X (0x400000+0x27f29) [0x427f29]
(EE)
(EE) [mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.
(EE) [mi] mieq is *NOT* the cause. It is a victim.
[ 39409.639] [mi] Increasing EQ size to 1024 to prevent dropped events.
[ 39409.640] [mi] EQ processing has resumed after 37 dropped events.
[ 39409.640] [mi] This may be caused my a misbehaving driver monopolizing the server's resources.
[ 40996.085] (II) Open ACPI successful (/var/run/acpid.socket)
[ 40996.906] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"
[ 41008.628] (EE) XKB: Could not invoke xkbcomp
[ 41008.628] (EE) XKB: Couldn't compile keymap
[ 47480.225] (II) Open ACPI successful (/var/run/acpid.socket)
[ 47480.444] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"
[ 47481.146] (EE) XKB: Could not invoke xkbcomp
[ 47481.146] (EE) XKB: Couldn't compile keymap
[ 50095.369] (II) Open ACPI successful (/var/run/acpid.socket)
[ 50095.418] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"
[ 50095.574] (EE) XKB: Could not invoke xkbcomp
[ 50095.574] (EE) XKB: Couldn't compile keymap
[ 72665.663] (II) Open ACPI successful (/var/run/acpid.socket)
[ 72665.811] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"
[ 72666.684] (EE) XKB: Could not invoke xkbcomp
[ 72666.684] (EE) XKB: Couldn't compile keymap
[ 94314.590] (II) Open ACPI successful (/var/run/acpid.socket)
[ 94315.877] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"
[ 94316.762] (EE) XKB: Could not invoke xkbcomp
[ 94316.762] (EE) XKB: Couldn't compile keymap
[103814.785] (II) Open ACPI successful (/var/run/acpid.socket)
[103814.897] (II) NVIDIA(0): Setting mode "DFP-0:2560x1440+0+0"


Just restarting does not seem to do the trick; issues return. I've tried installing various versions of the nvidia-drivers, to no avail. Does anyone have some recommendations on how to get my X (and display drivers) back under control? Especially how one might track down memory leaks in X, or debug the various call stacks.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Thu May 30, 2013 6:01 pm    Post subject: Reply with quote

How fast does it leak?
When you restart X, how much memory does it take and how fast does it grow? Do you need to run any programs to make it leak?
What version of nvidia-drivers are you using? Does downgrading or upgrading affect the behavior?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Thu May 30, 2013 6:47 pm    Post subject: Reply with quote

I rebooted 2 hours, 40 minutes ago.

X initially came up at 0.5% memory resources. It later (in the next 15 min or so) went up to 0.6%. I started several firefox windows in between, but this didn't immediately correlate with the memory increase. I also started thunderbird.

I put the PC to sleep for a couple hours and woke it back up.

Now it's using 2.4% of memory.

Quote:
# top
top - 20:35:43 up 2:40, 11 users, load average: 7.77, 7.10, 5.83
Tasks: 279 total, 10 running, 268 sleeping, 0 stopped, 1 zombie
%Cpu(s): 11.4 us, 7.0 sy, 74.4 ni, 7.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem: 16432228 total, 11262744 used, 5169484 free, 539284 buffers
KiB Swap: 8388604 total, 0 used, 8388604 free, 6034724 cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5110 user1 20 0 2896m 1.9g 61m R 76.4 12.0 88:24.85 firefox
3619 root 20 0 474m 379m 61m S 4.6 2.4 4:41.28 X


Recent versions of nvidia-drivers are as follows:

Quote:
Sun Mar 17 23:45:43 2013 >>> x11-drivers/nvidia-drivers-313.26
Wed May 1 23:49:10 2013 >>> x11-drivers/nvidia-drivers-313.30
Fri May 3 20:04:04 2013 >>> x11-drivers/nvidia-drivers-313.30
Sun May 5 18:28:54 2013 >>> x11-drivers/nvidia-drivers-313.30
Wed May 15 15:56:32 2013 >>> x11-drivers/nvidia-drivers-310.44


I haven't used this PC in a couple of weeks, which is why I've been on this version since May 15 in spite of the issues.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Thu May 30, 2013 10:12 pm    Post subject: Reply with quote

All the times so far that I've seen X11 "memory leaks" it tends to be X clients like Firefox allocating lots of pixbufs, and X11 allocating and freeing it. However X11 memory gets fragmented badly and a restart of X was necessary to clean things up. This seems exceptional however.

When you say it's at 0.5% and increase to 0.6%, did you do anything or did you just leave the machine idle and it goes up by itself?

It seems all the RAM is in specific process' names versus allocated by the kernel, which implies a userland bug (but not always). Seeing that your firefox process is huge (1.9GB!) - is this caused by you browsing or does it do it on its own? Does it matter which websites you browse to cause it to bloat up?

Does quitting firefox reduce the resident size of X11?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Fri May 31, 2013 12:29 am    Post subject: Reply with quote

So, more data points:

X was at 2.4% usage about 30 minutes ago (with lots and lots of firefox windows & tabs open). I went into sleep mode and came out and it was suddenly at 4.8%. This is with 16GB RAM and 8GB Swap.

I close firefox & check and I'm at 3.5%.

I restart firefox and I'm still at 3.5%

I go into sleep mode and wake up again and I'm at 4.1%.

This all might not seem like much, but it's the exact same configuration as when X was at 0.5% a couple hours ago.

Another cycle of going to sleep mode and coming back up and I'm at 4.5%...
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Fri May 31, 2013 4:52 am    Post subject: Reply with quote

If you have no web pages loaded I'd point to the graphics driver. It needs to deal with suspend/resume and could be a reason why it's bloating. Perhaps trying a different version driver or even going for nouveau for a short while to see if the driver can be ruled out.

I don't have nVidia hardware to see if it's reproduceable. Suspend/Resume does not work on my ATI closed source box so I can't use that as a data point...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Sun Jun 02, 2013 1:47 pm    Post subject: Reply with quote

The smoking gun:

Played a youtube video. The video froze about 12 seconds in. Memory usage of X shot up to 29.4% of available resources. Window switching is slow now.

Quote:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
10714 gink 20 0 3806m 2.7g 45m R 70.8 17.5 561:38.16 firefox
3619 root 20 0 4914m 4.6g 86m S 16.3 29.4 62:07.97 X


I'm using adobe-flash, since I was earlier suspecting gnash of being a culprit behind some of these issues.

Quote:
[I] www-plugins/adobe-flash
Available versions: 10.3.183.7^ms[1] ~10.3.183.86^ms 11.2.202.285^ms {{-32bit +64bit kde multilib selinux +sse2check vdpau}}
Installed versions: 11.2.202.285^ms(21:56:38 05/30/13)(64bit kde multilib sse2check vdpau -32bit -selinux)
Homepage: http://www.adobe.com/flashplayer
Description: Adobe Flash Player


...maybe I have to set up a VM in order to run flash in a more protected environment...crappy binary blob! :evil:

From experience, I've found that gnash is just not quite there for a general-purpose flash plugin, but it looks like it's time to revert back anyway.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9646
Location: almost Mile High in the USA

PostPosted: Sun Jun 02, 2013 4:02 pm    Post subject: Reply with quote

Still very odd as I do not see this behavior with flash on my system. Still might be driver-related...

Here's after a few minutes of youtube flashplayer usage: (the Adobe flash player should be forked in plugin-container... is this not working?

Code:
  PID USER      PR  NI  VIRT  RES  SHR S  %CPU     TIME+ P SWAP COMMAND         
 2201 root      20   0  481m 194m 157m S   4.7   1:18.13 3    0 X               
 2848 uuu       20   0 1051m 193m  40m S   5.6   2:07.60 1    0 firefox         
 3208 uuu       20   0  661m 125m  29m S  20.9   1:31.39 1    0 plugin-container


Edit: I noticed I am running on www-plugins/adobe-flash: USE= -32bit +64bit -kde +sse2check -vdpau
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum