After my computer's performance recently slowed to a crawl, I checked the output of free to find a drastic increase in memory usage:
Code:
total used free shared buffers cached
Mem: 16033 15798 234 0 23 112
-/+ buffers/cache: 15662 370
Swap: 16383 13187 3196
Since I wasn't running much that should be that memory intensive aside from firefox, I used ps to find the most memory intensive processes and discovered that Xorg was surprisingly using over 22 gigs of memory!
Code:
$ ps aux --sort rss | tail -1
root 1940 12.0 66.0 22723076 10846748 tty7 Ss+ Feb08 4717:13 /usr/bin/Xorg :0 -br -verbose -audit 0 -novtswitch -auth /var/run/gdm3/auth-for-Debian-gdm-kItIIs/database -nolisten tcp vt7
Furthermore, Xorg's /proc/pid/smaps info shows most of that memory being in the heap:
Code:
00992000-562329000 rw-p 00000000 00:00 0 [heap]
Size: 22570588 kB
Rss: 10833672 kB
Pss: 10833672 kB
Shared_Clean: 0 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 10833672 kB
Referenced: 5128364 kB
Anonymous: 10833672 kB
AnonHugePages: 0 kB
Swap: 11736648 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Locked: 0 kB
However, not much memory usage seems to show up in xrestop aside from firefox, which is an order of magnitude smaller than the heap size, and is mostly in pixmaps. In fact, it is showing the total memory usage across all monitored clients as being only slightly higher than firefox's usage, at ~1.7 gigs:
Code:
xrestop - Display: :0.0
Monitoring 36 clients. XErrors: 0
Pixmaps: 1698868K total, Other: 300K total, All: 1699169K total
res-base Wins GCs Fnts Pxms Misc Pxm mem Other Total PID Identifier
3200000 375 54 1 2951 3710 1674984K 98K 1675082K 8886 Problem loading page - Mozilla Firefox
3400000 20 28 1 18 73 6788K 3K 6792K 4481 <unknown>
1600000 9 41 1 13 40 5056K 3K 5059K 2327 x-nautilus-desktop
0000000 1 0 2 0 110 4800K 4K 4804K ? <unknown>
3600000 0 0 0 1 0 4800K 0B 4800K ? <unknown>
3c00000 23 28 1 7 65 1673K 3K 1677K 20161 <unknown>
1200000 49 32 1 19 87 256K 4K 260K 2430 hiko@votocon: ~/Desktop
4a00000 9 42 1 19 61 256K 3K 259K 24958 *Unsaved Document 3 - gedit
1400000 48 75 1 23 149 226K 7K 234K 2321 Panel
1000000 66 30 2 11 5380 14B 130K 130K 2314 metacity
0c00000 7 54 1 19 306 11K 9K 21K 2310 gnome-settings-daemon
2a00000 7 54 0 5 17 9K 1K 10K 2343 update-notifier
3800000 13 67 1 28 67 4K 4K 8K 29938 Pidgin
2800000 3 27 0 1 234 4B 6K 6K 2340 gnome-screensaver
2200000 14 41 0 19 49 1K 2K 4K 2351 Volume Applet
4400000 3 29 1 17 44 20B 2K 2K 22328 gksu
4600000 5 38 1 5 21 8B 2K 2K 22346
2600000 2 5 1 15 43 18B 2K 2K 2341 polkit-gnome-authentication-agent-1
4e00000 2 3 0 4 88 7B 2K 2K 19146 notification-daemon
2c00000 6 56 0 8 26 14B 2K 2K 2344 NetworkManager Applet
0e00000 4 28 0 2 20 8B 1K 1K 2306 gnome-power-manager
0200000 0 1 1 0 0 0B 1K 1K ? <unknown>
3000000 2 2 0 1 9 4B 312B 316B 2336 system-config-printer-applet
3a00000 1 3 0 0 9 0B 312B 312B 23459 MPlayer
0600000 2 3 0 1 7 4B 288B 292B 2248 seahorse-agent
0a00000 2 1 0 0 8 0B 264B 264B 2248 x-session-manager
2400000 2 1 0 1 7 4B 240B 244B 2339 kerneloops-applet
1e00000 2 1 0 1 7 4B 240B 244B 2334 Bluetooth Applet
1c00000 2 1 0 1 7 4B 240B 244B 2338 gdu-notification-daemon
2e00000 2 1 0 0 6 0B 216B 216B 2342 evolution-alarm-notify
1800000 2 1 0 0 6 0B 216B 216B 2155 polkit-gnome-authentication-agent-1
3e00000 1 1 0 0 0 0B 48B 48B ? xrestop
0400000 1 1 0 0 0 0B 48B 48B ? <unknown>
2000000 0 1 0 0 0 0B 24B 24B ? <unknown>
1a00000 0 1 0 0 0 0B 24B 24B ? <unknown>
0800000 0 1 0 0 0 0B 24B 24B ? <unknown>
I also didn't notice anything that looked like it might be responsible in my .xsession-errors file. I'm not quite sure how to continue debugging this, though I do feel pretty confident that I should not ever have Xorg consuming nearly this much memory - I'm almost up to using all 32 gigs of available memory after having closed almost everything but firefox! Does anybody know what might be going wrong and how to prevent it from happening again? Output of Xorg -version:
Code:
X.Org X Server 1.7.7
Release Date: 2010-05-04
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.0.0-1-amd64 x86_64 Debian
Current Operating System: Linux votocon 3.2.0-0.bpo.4-amd64 #1 SMP Debian 3.2.35-2~bpo60+1 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-3.2.0-0.bpo.4-amd64 root=UUID=ad6cd88c-f05c-4a2a-9a38-be793046f51a ro quiet
Build Date: 29 October 2011 06:58:14PM
xorg-server 2:1.7.7-14 (Julien Cristau <jcristau@debian.org>)
Current version of pixman: 0.16.4
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Also, this is the contents of my xorg.conf file:
Code:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 310.19 (buildmeister@swio-display-x86-rhel47-08.nvidia.com) Thu Nov 8 02:09:12 PST 2012
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection