Where does the memory go?


 
Thread Tools Search this Thread
Operating Systems Linux Where does the memory go?
# 1  
Old 06-21-2009
Where does the memory go?

I've been running a bit low on memory recently, so I decided to find out where it's going. Obviously my browser is pretty memory-intensive, but I'm not sure there's much I can do about that (short of browsing less, all I can do is tune settings and/or change browsers). So I opened the system monitor and closed out the biggest memory users: firefox, soffice.bin, evolution*, and evince (I had a decent-sized PDF open). After closing those the memory use came down a bit: the largest memory users remaining were nautilus and gedit at 16 and 10 MB, respectively; everything else was taking a very small amount of RAM.

But the total memory use was still above 800 MiB: I calculated 810-812 MB not accounted for in the system monitor. The system monitor helpfully reported: "51% in use from programs, 11% for the cache" or something similar. Why is memory use so high? Vista only requires 512 MB; I have trouble believing that Ubuntu is greedier.

So I guess my questions come down to:
1. What is using the remaining 800 MB?
2. How can I reasonably conserve memory?
3. How long before someone tells me to buy another 2GB? Smilie

* Why was evolution running in the first place? I don't use it and I've never opened it.
# 2  
Old 06-21-2009
Quote:
Originally Posted by CRGreathouse
I've been running a bit low on memory recently, so I decided to find out where it's going. Obviously my browser is pretty memory-intensive, but I'm not sure there's much I can do about that (short of browsing less, all I can do is tune settings and/or change browsers). So I opened the system monitor and closed out the biggest memory users: firefox, soffice.bin, evolution*, and evince (I had a decent-sized PDF open). After closing those the memory use came down a bit: the largest memory users remaining were nautilus and gedit at 16 and 10 MB, respectively; everything else was taking a very small amount of RAM.
Most (some) UNIX systems will fill memory intentionally. This is done to prevent paging as much as possible. Unless your disk is thrashing, I see no real problem here. (You haven't told us how much memory you have though.)

Quote:
But the total memory use was still above 800 MiB: I calculated 810-812 MB not accounted for in the system monitor. The system monitor helpfully reported: "51% in use from programs, 11% for the cache" or something similar. Why is memory use so high? Vista only requires 512 MB; I have trouble believing that Ubuntu is greedier.

So I guess my questions come down to:
1. What is using the remaining 800 MB?
2. How can I reasonably conserve memory?
3. How long before someone tells me to buy another 2GB? Smilie

* Why was evolution running in the first place? I don't use it and I've never opened it.
Autostart at login? Check your session startup list.
# 3  
Old 06-21-2009
Quote:
Originally Posted by glen.barber
Most (some) UNIX systems will fill memory intentionally. This is done to prevent paging as much as possible. Unless your disk is thrashing, I see no real problem here. (You haven't told us how much memory you have though.)
I only posted because it had been thrashing. (Now that it's under the limit there's no problem, but I suspect that when I go over again it will do the same.) I identified this by
1. A marked slowdown in all processes
2. Hard drive sound
3. The yellow virtual memory meter (I have the system monitor in my panel) spiked up, where it had previously (hours or days) been flat

I have 2 GB of memory.
# 4  
Old 06-21-2009
See this post on Linux memory:

Free Linux Memory by Dropping Caches
# 5  
Old 07-03-2009
Quote:
Originally Posted by CRGreathouse
I've been running a bit low on memory recently, so I decided to find out where it's going. Obviously my browser is pretty memory-intensive, but I'm not sure there's much I can do about that (short of browsing less, all I can do is tune settings and/or change browsers). So I opened the system monitor and closed out the biggest memory users: firefox, soffice.bin, evolution*, and evince (I had a decent-sized PDF open). After closing those the memory use came down a bit: the largest memory users remaining were nautilus and gedit at 16 and 10 MB, respectively; everything else was taking a very small amount of RAM.
Instead of 'system monitor', whatever that is, try standard UNIX tools like ps. pastebinning the outputs of 'ps aux' would be informative.
# 6  
Old 07-07-2009
Quote:
Originally Posted by Corona688
Instead of 'system monitor', whatever that is, try standard UNIX tools like ps. pastebinning the outputs of 'ps aux' would be informative.
By system monitor I mean the application gnome-system-monitor.

My problem is somewhat decreased by buying up to 4 GB of RAM, but as that's currently full (albeit no performance hit yet) I'll give the output requested:
Code:
user@computer:~$ ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   4104   364 ?        Ss   Jul04   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   Jul04   0:01 [migration/0]
root         4  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   Jul04   0:00 [watchdog/0]
root         6  0.0  0.0      0     0 ?        S<   Jul04   0:01 [migration/1]
root         7  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksoftirqd/1]
root         8  0.0  0.0      0     0 ?        S<   Jul04   0:00 [watchdog/1]
root         9  0.0  0.0      0     0 ?        S<   Jul04   0:01 [migration/2]
root        10  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksoftirqd/2]
root        11  0.0  0.0      0     0 ?        S<   Jul04   0:00 [watchdog/2]
root        12  0.0  0.0      0     0 ?        S<   Jul04   0:01 [migration/3]
root        13  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksoftirqd/3]
root        14  0.0  0.0      0     0 ?        S<   Jul04   0:00 [watchdog/3]
root        15  0.0  0.0      0     0 ?        S<   Jul04   0:00 [events/0]
root        16  0.0  0.0      0     0 ?        S<   Jul04   0:00 [events/1]
root        17  0.0  0.0      0     0 ?        S<   Jul04   0:00 [events/2]
root        18  0.0  0.0      0     0 ?        S<   Jul04   0:00 [events/3]
root        19  0.0  0.0      0     0 ?        S<   Jul04   0:00 [khelper]
root        20  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kstop/0]
root        21  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kstop/1]
root        22  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kstop/2]
root        23  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kstop/3]
root        24  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kintegrityd/0]
root        25  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kintegrityd/1]
root        26  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kintegrityd/2]
root        27  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kintegrityd/3]
root        28  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kblockd/0]
root        29  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kblockd/1]
root        30  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kblockd/2]
root        31  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kblockd/3]
root        32  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kacpid]
root        33  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kacpi_notify]
root        34  0.0  0.0      0     0 ?        S<   Jul04   0:00 [cqueue]
root        35  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ata/0]
root        36  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ata/1]
root        37  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ata/2]
root        38  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ata/3]
root        39  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ata_aux]
root        40  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksuspend_usbd]
root        41  0.0  0.0      0     0 ?        S<   Jul04   0:00 [khubd]
root        42  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kseriod]
root        43  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmmcd]
root        44  0.0  0.0      0     0 ?        S<   Jul04   0:00 [btaddconn]
root        45  0.0  0.0      0     0 ?        S<   Jul04   0:00 [btdelconn]
root        48  0.0  0.0      0     0 ?        S<   Jul04   0:05 [kswapd0]
root        49  0.0  0.0      0     0 ?        S<   Jul04   0:00 [aio/0]
root        50  0.0  0.0      0     0 ?        S<   Jul04   0:00 [aio/1]
root        51  0.0  0.0      0     0 ?        S<   Jul04   0:00 [aio/2]
root        52  0.0  0.0      0     0 ?        S<   Jul04   0:00 [aio/3]
root        53  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ecryptfs-kthr]
root        56  0.0  0.0      0     0 ?        S<   Jul04   0:00 [scsi_eh_0]
root        57  0.0  0.0      0     0 ?        S<   Jul04   0:06 [scsi_eh_1]
root        58  0.0  0.0      0     0 ?        S<   Jul04   0:00 [scsi_eh_2]
root        59  0.0  0.0      0     0 ?        S<   Jul04   0:00 [scsi_eh_3]
root        60  0.0  0.0      0     0 ?        S<   Jul04   0:00 [scsi_eh_4]
root        61  0.0  0.0      0     0 ?        S<   Jul04   0:00 [scsi_eh_5]
root        62  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kstriped]
root        63  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmpathd/0]
root        64  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmpathd/1]
root        65  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmpathd/2]
root        66  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmpathd/3]
root        67  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kmpath_handle]
root        68  0.0  0.0      0     0 ?        S<   Jul04   0:00 [ksnapd]
root        69  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kondemand/0]
root        70  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kondemand/1]
root        71  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kondemand/2]
root        72  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kondemand/3]
root        73  0.0  0.0      0     0 ?        S<   Jul04   0:00 [krfcommd]
root       380  0.0  0.0      0     0 ?        S<   Jul04   0:00 [khpsbpkt]
root       672  0.0  0.0      0     0 ?        S<   Jul04   0:00 [knodemgrd_0]
root       799  0.0  0.0      0     0 ?        S<   Jul04   0:14 [kjournald]
root       933  0.0  0.0  16788   184 ?        S<s  Jul04   0:00 /sbin/udevd --d
root      1629  0.0  0.0      0     0 ?        S<   Jul04   0:00 [kpsmoused]
root      2272  0.0  0.0   3944   240 tty4     Ss+  Jul04   0:00 /sbin/getty 384
root      2273  0.0  0.0   3944   240 tty5     Ss+  Jul04   0:00 /sbin/getty 384
root      2276  0.0  0.0   3944   240 tty2     Ss+  Jul04   0:00 /sbin/getty 384
root      2278  0.0  0.0   3944   240 tty3     Ss+  Jul04   0:00 /sbin/getty 384
root      2280  0.0  0.0   3944   240 tty6     Ss+  Jul04   0:00 /sbin/getty 384
root      2354  0.0  0.0   4604   240 ?        Ss   Jul04   0:00 /usr/sbin/acpid
syslog    2393  0.0  0.0  12376   460 ?        Ss   Jul04   0:01 /sbin/syslogd -
root      2416  0.0  0.0   8204   236 ?        S    Jul04   0:00 /bin/dd bs 1 if
klog      2418  0.0  0.0   7144   348 ?        Ss   Jul04   0:00 /sbin/klogd -P
108       2441  0.0  0.0  21720  1084 ?        Ss   Jul04   0:12 /bin/dbus-daemo
111       2599  0.0  0.0  36560  1848 ?        Ss   Jul04   0:08 /usr/sbin/hald
root      2602  0.0  0.0 107436  2624 ?        Ssl  Jul04   0:05 /usr/sbin/conso
root      2666  0.0  0.0  15816   756 ?        S    Jul04   0:00 hald-runner
root      2695  0.0  0.0  28484   544 ?        S    Jul04   0:00 hald-addon-inpu
root      2747  0.0  0.0  28484   688 ?        S    Jul04   0:09 hald-addon-stor
root      2748  0.0  0.0  28492   448 ?        S    Jul04   0:00 /usr/lib/hal/ha
111       2749  0.0  0.0  32392   372 ?        S    Jul04   0:00 hald-addon-acpi
root      2767  0.0  0.0  28356   528 ?        Ss   Jul04   0:00 /usr/sbin/bluet
root      2806  0.0  0.0 123136   428 ?        Ss   Jul04   0:00 /usr/sbin/gdm
root      2809  0.0  0.0 144164   804 ?        S    Jul04   0:00 /usr/sbin/gdm
root      2814  4.9 40.6 1927648 1414296 tty7  Rs+  Jul04 141:43 /usr/X11R6/bin/
root      2833  0.0  0.0  36676   388 ?        Ss   Jul04   0:02 /usr/sbin/atiev
root      2865  0.0  0.0  70988  1284 ?        Ssl  Jul04   0:04 /usr/sbin/Netwo
avahi     2884  0.0  0.0  31896   588 ?        Ss   Jul04   0:01 avahi-daemon: r
avahi     2885  0.0  0.0  31764   124 ?        Ss   Jul04   0:00 avahi-daemon: c
root      2896  0.0  0.0  21100   332 ?        S    Jul04   0:00 /sbin/wpa_suppl
root      2899  0.0  0.0  69120  1232 ?        S    Jul04   0:01 /usr/sbin/nm-sy
root      2917  0.0  0.0  67960  1156 ?        Ss   Jul04   0:00 /usr/sbin/cupsd
root      2946  0.0  0.0  33296   504 ?        Ss   Jul04   0:00 /usr/bin/system
daemon    3019  0.0  0.0  16524   188 ?        Ss   Jul04   0:00 /usr/sbin/atd
root      3047  0.0  0.0  19972   356 ?        Ss   Jul04   0:00 /usr/sbin/cron
root      3144  0.0  0.0      0     0 ?        S<   Jul04   0:00 [firegl]
root      3145  0.0  0.0   3944   240 tty1     Ss+  Jul04   0:00 /sbin/getty 384
root      3164  0.0  0.0   6488   608 ?        S    Jul04   0:02 /sbin/dhclient
ntp       3280  0.0  0.0  29708   684 ?        Ss   Jul04   0:01 /usr/sbin/ntpd
charles   3454  0.0  0.0  84092   784 ?        S    Jul04   0:00 /usr/bin/gnome-
charles   3466  0.0  0.0 173984  2728 ?        Ssl  Jul04   0:03 x-session-manag
charles   3523  0.0  0.0  35940   128 ?        Ss   Jul04   0:00 /usr/bin/ssh-ag
charles   3526  0.0  0.0  23824   260 ?        S    Jul04   0:00 /usr/bin/dbus-l
charles   3527  0.0  0.0  21792  1172 ?        Ss   Jul04   0:01 //bin/dbus-daem
charles   3532  0.2  0.1 372328  3828 ?        Ssl  Jul04   5:50 /usr/bin/pulsea
charles   3533  0.0  0.0  68048   752 ?        S    Jul04   0:00 /usr/lib/pulsea
charles   3535  0.0  0.0  46076  3044 ?        S    Jul04   0:26 /usr/lib/libgco
charles   3546  0.0  0.0 165056  2024 ?        Ss   Jul04   0:00 /usr/bin/seahor
charles   3552  0.0  0.1 225740  4116 ?        Ssl  Jul04   0:30 /usr/lib/gnome-
charles   3556  0.0  0.0  41248  1396 ?        S    Jul04   0:00 /usr/lib/gvfs/g
charles   3564  0.0  0.0 144868  1056 ?        Ssl  Jul04   0:00 /usr/lib/gvfs//
charles   3570  0.0  0.0   4024   200 ?        S    Jul04   0:00 /bin/sh /usr/bi
charles   3637  0.3  0.1 234780  4916 ?        S    Jul04   9:16 /usr/bin/compiz
charles   3638  0.2  0.6 348612 23272 ?        S    Jul04   5:52 gnome-panel
charles   3640  0.0  0.7 529244 24704 ?        S    Jul04   0:43 nautilus
charles   3642  0.0  0.0 152348   820 ?        Ssl  Jul04   0:00 /usr/lib/bonobo
charles   3646  0.0  0.1 191976  3688 ?        S    Jul04   0:03 nm-applet --sm-
charles   3648  0.0  0.1 237344  4304 ?        S    Jul04   0:08 update-notifier
charles   3650  0.0  0.0 227248  3084 ?        Ss   Jul04   0:04 gnome-power-man
charles   3654  0.0  0.0 146936  2364 ?        S    Jul04   0:00 /usr/lib/notify
charles   3658  0.0  0.0  45424  1616 ?        S    Jul04   0:00 /usr/lib/gvfs/g
charles   3664  0.0  0.1 220100  3752 ?        S    Jul04   0:00 /usr/lib/gnome-
charles   3666  0.0  0.0  56136  1396 ?        S    Jul04   0:00 /usr/lib/gvfs/g
charles   3668  0.0  0.0  54484  1060 ?        S    Jul04   0:00 /usr/lib/gvfs/g
charles   3669  0.0  0.0   4024   184 ?        Ss   Jul04   0:00 /bin/sh -c /usr
charles   3670  0.0  0.0   4024   192 ?        S    Jul04   0:00 /bin/sh /usr/bi
charles   3672  0.1  0.2 195724  8048 ?        S    Jul04   2:54 /usr/bin/gtk-wi
charles   3675  0.4  0.1 217376  5552 ?        S    Jul04  13:26 /usr/lib/gnome-
charles   3681  0.0  0.1 280584  5532 ?        Sl   Jul04   0:01 /usr/lib/gnome-
charles   3687  0.0  0.0  40856   804 ?        S    Jul04   0:00 /usr/lib/gvfs/g
charles   3700 12.3 18.5 1626924 647508 ?      Rl   Jul04 357:07 /usr/lib/firefo
charles   3723  0.0  0.1 162048  3800 ?        Ss   Jul04   2:04 gnome-screensav
root      4014  0.0  0.0  72664  3360 ?        S    Jul04   0:00 /usr/bin/python
charles   5469  0.0  0.0 462340  2212 ?        Sl   Jul05   0:00 /usr/lib/evolut
charles   5473  0.0  0.0 414784  2596 ?        Sl   Jul05   0:00 /usr/lib/evolut
charles   5483  0.0  0.1 425940  3660 ?        Sl   Jul05   0:00 /usr/lib/evolut
charles   5929  0.2  0.5 200944 18096 ?        Sl   23:25   0:00 gnome-terminal
charles   5930  0.0  0.0  14412   784 ?        S    23:25   0:00 gnome-pty-helpe
charles   5931  0.0  0.1  20740  3548 pts/0    Ss+  23:25   0:00 bash
charles   6093  5.3  0.1  20840  3648 pts/1    Ss   23:32   0:00 bash
charles   6109  0.0  0.0  15172  1136 pts/1    R+   23:32   0:00 ps aux
charles   6414  0.1  2.8 378084 97976 ?        Sl   Jul05   4:46 evince file:///
charles  16229  0.2  4.0 918172 142004 ?       Sl   Jul05   5:46 /usr/lib/openof
root     32686  0.0  0.0      0     0 ?        S    Jul05   0:00 [pdflush]
root     32687  0.0  0.0      0     0 ?        S    Jul05   0:00 [pdflush]

# 7  
Old 07-09-2009
That big honking thing leaking 40% of your RAM and counting looks like your X server. Note how its actual memory consumption is way higher than the amount still paged in(RSS), its allocating lots of memory, not using it, and having it paged out to make room for more! Try upgrading it.

(You can avoid the lines getting cut off by redirecting ps into a file or pipe, by the way.)

Last edited by Corona688; 07-09-2009 at 03:37 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

[DOUBT] Memory high in idle process on Solaris 10 (Memory Utilization > 90%)

Hi Experts, Our servers running Solaris 10 with SAP Application. The memory utilization always >90%, but the process on SAP is too less even nothing. Why memory utilization on solaris always looks high? I have statement about memory on solaris, is this true: Memory in solaris is used for... (4 Replies)
Discussion started by: edydsuranta
4 Replies

2. Solaris

relationship or difference between entitled memory and locked memory

Hello solaris experts, Being new to solaris containers, from Linux, feeling difficulty in understanding certain concepts. Hope somebody can help me here. I understand that, & some questions .... Locked memory -- memory which will not be swapped out at any cause. is this for... (0 Replies)
Discussion started by: thegeek
0 Replies

3. UNIX for Advanced & Expert Users

Out of Memory error when free memory size is large

I was running a program and it stopped and showed "Out of Memory!". at that time, the RAM used by this process is around 4G and the free memory size of the machine is around 30G. Does anybody know what maybe the reason? this program is written with Perl. the OS of the machine is Solaris U8. And I... (1 Reply)
Discussion started by: lilili07
1 Replies

4. Solaris

restrcit physical memory with zone.max-locked-memory

Is it possible to restrict physical memory in solaris zone with zone.max-locked-memory just like we can do with rcapd ? I do not want to used rcapd (1 Reply)
Discussion started by: fugitive
1 Replies

5. Programming

How to deal with lots of data in memory in order not to run out of memory

Hi, I'm trying to learn how to manage memory when I have to deal with lots of data. Basically I'm indexing a huge file (5GB, but it can be bigger), by creating tables that holds offset <-> startOfSomeData information. Currently I'm mapping the whole file at once (yep!) but of course the... (1 Reply)
Discussion started by: emitrax
1 Replies

6. Solaris

How to find Total and Free Physical Memory and Logical Memory in SOLARIS 9

Hi, Im working on Solaris 9 on SPARC-32 bit running on an Ultra-80, and I have to find out the following:- 1. Total Physical Memory in the system(total RAM). 2. Available Physical Memory(i.e. RAM Usage) 3. Total (Logical) Memory in the system 4. Available (Logical) Memory. I know... (4 Replies)
Discussion started by: 0ktalmagik
4 Replies

7. AIX

ulimits max locked memory virtual memory

Hi, Would any one be so kind to explain me : are ulimits defined for each user seperately ? When ? Specialy what is the impact of : max locked memory and virtual memory on performance of applications for a user. Many thanks. PS : this is what I can see in MAN : ulimit ] ... (5 Replies)
Discussion started by: big123456
5 Replies

8. HP-UX

How can I get memory usage or anything that show memory used from sar file?

Refer from title: How can i get memory used or anything that can show memory from sar file example on solaris:- we can use sar with option to show memory used at time that sar crontab run. on HP-UX, it not has option to see memory used. But i think it may be have some parameter or some... (1 Reply)
Discussion started by: panithat
1 Replies

9. Programming

how to round up a memory address(memory alignment problem)

Hi, I try to marshal a unsigned int and a char * into a buffer, and then unmarshal them later to get them out. I need to put the char * in the front and unsigned int at the end of the buffer. However, my system always give me "BUS ERROR". I am using Sun Sparcs Sloris 2.10. My code to marshal... (6 Replies)
Discussion started by: nj302
6 Replies
Login or Register to Ask a Question