Excessive memory usage

Bug #135166 reported by xdude
2
Affects Status Importance Assigned to Milestone
Ubuntu
Invalid
Undecided
Unassigned

Bug Description

Hello. I have x86 Kubuntu Feisty on 2.6.20-16-generic kernel, Pentium-D with 2 cores, 2048 MB RAM. After my computer is just rebooted, I have about 300-400MB of memory in use, and other 1600MB free. And this is normal. But after some time of usual work (browsing Internet with Firefox, using KDevelop and Eclipse for programming, viewing a movie and so on) something wrong happens with my memory: all 2GB are full and and even some swap space is allocated. I closed all windows on my KDE desktop, but this did not help: only about 200-300MB of memory were released. So I logged off the KDE session, switched to the terminal and killed kdm daemon (and the X server died either of course). But only ~100MB of memory has been released after that. I even stopped some services from /etc/init.d directory, and the picture became like that: about 1600MB of my memory were used, and only about 400MB were free. Here is the output of "ps aux" command, although I can't see anything that can consume lot of memory here:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 2908 1848 ? Ss Aug26 0:01 /sbin/init
root 2 0.0 0.0 0 0 ? S Aug26 0:00 [migration/0]
root 3 0.0 0.0 0 0 ? SN Aug26 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S Aug26 0:00 [watchdog/0]
root 5 0.0 0.0 0 0 ? S Aug26 0:00 [migration/1]
root 6 0.0 0.0 0 0 ? SN Aug26 0:00 [ksoftirqd/1]
root 7 0.0 0.0 0 0 ? S Aug26 0:00 [watchdog/1]
root 8 0.0 0.0 0 0 ? S< Aug26 0:00 [events/0]
root 9 0.0 0.0 0 0 ? S< Aug26 0:00 [events/1]
root 10 0.0 0.0 0 0 ? S< Aug26 0:00 [khelper]
root 11 0.0 0.0 0 0 ? S< Aug26 0:00 [kthread]
root 35 0.0 0.0 0 0 ? S< Aug26 0:00 [kblockd/0]
root 36 0.0 0.0 0 0 ? S< Aug26 0:00 [kblockd/1]
root 37 0.0 0.0 0 0 ? S< Aug26 0:00 [kacpid]
root 38 0.0 0.0 0 0 ? S< Aug26 0:00 [kacpi_notify]
root 135 0.0 0.0 0 0 ? S< Aug26 0:00 [kseriod]
root 162 0.0 0.0 0 0 ? S Aug26 0:00 [pdflush]
root 163 0.0 0.0 0 0 ? S Aug26 0:00 [pdflush]
root 164 0.0 0.0 0 0 ? S< Aug26 0:00 [kswapd0]
root 165 0.0 0.0 0 0 ? S< Aug26 0:00 [aio/0]
root 166 0.0 0.0 0 0 ? S< Aug26 0:00 [aio/1]
root 797 0.0 0.0 0 0 ? S Aug26 0:00 [kirqd]
root 2000 0.0 0.0 0 0 ? S< Aug26 1:12 [ata/0]
root 2001 0.0 0.0 0 0 ? S< Aug26 0:05 [ata/1]
root 2002 0.0 0.0 0 0 ? S< Aug26 0:00 [ata_aux]
root 2017 0.0 0.0 0 0 ? S< Aug26 0:00 [ksuspend_usbd]
root 2018 0.0 0.0 0 0 ? S< Aug26 0:00 [khubd]
root 2131 0.0 0.0 0 0 ? S< Aug26 0:09 [scsi_eh_0]
root 2132 0.0 0.0 0 0 ? S< Aug26 0:00 [scsi_eh_1]
root 2183 0.0 0.0 0 0 ? S< Aug26 0:00 [scsi_eh_2]
root 2184 0.0 0.0 0 0 ? S< Aug26 0:00 [scsi_eh_3]
root 2456 0.0 0.0 0 0 ? S< Aug26 0:03 [kjournald]
root 2655 0.0 0.0 2908 1252 ? S<s Aug26 0:00 /sbin/udevd --daemon
root 3719 0.0 0.0 0 0 ? S< Aug26 0:00 [kpsmoused]
root 4228 0.0 0.0 0 0 ? S< Aug26 0:00 [kjournald]
root 4481 0.0 0.0 1652 508 tty4 Ss+ Aug26 0:00 /sbin/getty 38400 tty4
root 4482 0.0 0.0 1648 508 tty5 Ss+ Aug26 0:00 /sbin/getty 38400 tty5
root 4484 0.0 0.0 1652 512 tty2 Ss+ Aug26 0:00 /sbin/getty 38400 tty2
root 4486 0.0 0.0 1648 508 tty3 Ss+ Aug26 0:00 /sbin/getty 38400 tty3
root 4488 0.0 0.0 2752 1204 tty1 Ss Aug26 0:00 /bin/login --
root 4489 0.0 0.0 1652 512 tty6 Ss+ Aug26 0:00 /sbin/getty 38400 tty6
root 4747 0.0 0.0 2260 1184 ? Ss Aug26 0:00 /usr/sbin/acpid -c /etc/acpi/events -s /var/run/acpid.socket
root 4864 0.0 0.0 1700 660 ? Ss Aug26 0:00 /sbin/syslogd
root 4921 0.0 0.0 1796 528 ? Ss Aug26 0:00 /bin/dd bs 1 if /proc/kmsg of /var/run/klogd/kmsg
klog 4923 0.0 0.0 2428 1372 ? Ss Aug26 0:00 /sbin/klogd -P /var/run/klogd/kmsg
104 4944 0.0 0.0 2716 996 ? Ss Aug26 0:00 /usr/bin/dbus-daemon --system
107 4960 0.0 0.4 10696 9004 ? Ss Aug26 0:02 /usr/sbin/hald
root 4961 0.0 0.0 2880 1028 ? S Aug26 0:00 hald-runner
107 4967 0.0 0.0 2100 884 ? S Aug26 0:00 hald-addon-acpi: listening on acpid socket /var/run/acpid.socket
107 4981 0.0 0.0 2100 900 ? S Aug26 0:00 hald-addon-keyboard: listening on /dev/input/event3
107 4984 0.0 0.0 2100 900 ? S Aug26 0:00 hald-addon-keyboard: listening on /dev/input/event4
107 4989 0.0 0.0 2100 896 ? S Aug26 0:00 hald-addon-keyboard: listening on /dev/input/event5
107 4992 0.0 0.0 2100 896 ? S Aug26 0:00 hald-addon-keyboard: listening on /dev/input/event6
107 5009 0.0 0.0 2104 908 ? S Aug26 0:37 hald-addon-storage: polling /dev/scd0
root 5022 0.0 0.0 1940 696 ? Ss Aug26 0:00 /usr/sbin/dhcdbd --system
avahi 5040 0.0 0.0 2780 1436 ? Ss Aug26 0:00 avahi-daemon: running [core.local]
avahi 5041 0.0 0.0 2672 464 ? Ss Aug26 0:00 avahi-daemon: chroot helper
root 5427 0.0 0.0 2772 708 ? Ss Aug26 0:00 /usr/bin/dirmngr --daemon --sh
root 5519 0.0 0.0 2352 856 ? Ss Aug26 0:00 /usr/sbin/xinetd -pidfile /var/run/xinetd.pid -stayalive
root 5549 0.0 0.0 7744 1896 ? Ss Aug26 0:00 sendmail: MTA: accepting connections
root 5590 0.0 0.0 2700 1036 ? Ss Aug26 0:00 /usr/sbin/hcid -x -s
root 5610 0.0 0.0 0 0 ? S< Aug26 0:00 [krfcommd]
proftpd 5634 0.0 0.0 9276 1548 ? Ss Aug26 0:00 proftpd: (accepting connections)
daemon 5667 0.0 0.0 1908 420 ? Ss Aug26 0:00 /usr/sbin/atd
root 5681 0.0 0.0 2284 900 ? Ss Aug26 0:00 /usr/sbin/cron
jed 14424 0.0 0.1 6020 3508 tty1 S 01:00 0:00 -bash
root 14442 0.1 0.2 7804 5604 tty1 S 01:00 0:01 bash
root 14479 0.0 0.0 1988 408 ? S 01:04 0:00 /sbin/usplash -c -x 1024 -y 768
root 14844 0.0 0.0 3624 824 ? Ss 01:15 0:00 /sbin/mount.ntfs-3g /dev/sda2 /media/sda2 -o rw,codepage=866,nls=utf8,fmask=0111,gid=46,uid=1000
root 15196 0.0 0.0 2560 992 tty1 R+ 01:25 0:00 ps aux

And here is the output of "free -m" after I had started kdm and logged back in to the KDE desktop:
             total used free shared buffers cached
Mem: 2027 1762 264 0 98 1433
-/+ buffers/cache: 230 1796
Swap: 3906 14 3891

So KDE "eats" only about 150MB of RAM, and the problem is somewhere in the system kernel or system services.
I noticed such behavior twice, but formerly I didn't even take an interest in my system statistics.

xdude (uniqus)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote :

Thank you for trying to help make Ubuntu better. However this seems to be normal (and desirable) behaviour. The general principle is: if RAM isn't used, it's wasted.

The "cache" entry in your free -m results indicates that the kernel currently has a 1.4Gb disc cache. This memory is free for application use - if an application requests more RAM, some of that disc cache will be dropped. The second entry in your +/- buffers/cache indicates that, as far as applications are concerned, you have 1796 Mb of RAM free.

You can see «http://gentoo-wiki.com/FAQ_Linux_Memory_Management» for more details about how the linux kernel manages memory.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.