Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
memory usage question
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jcpunk
n00b
n00b


Joined: 22 Jul 2003
Posts: 37

PostPosted: Wed Jan 14, 2004 6:47 pm    Post subject: memory usage question Reply with quote

I am a little bit confused why 30% of my avalible memory is being used at boot when I am not running ANYTHING.

top reports:
Code:

Tasks:  23 total,   1 running,  22 sleeping,   0 stopped,   0 zombie
Cpu(s):   7.0% user,   4.4% system,   0.0% nice,  88.6% idle
Mem:    192152k total,    63864k used,   167888k free,     1868k buffers
Swap:   417672k total,        0k used,   417672k free,    15036k cached

  PID USER    PR  NI  VIRT  RES   SHR S %CPU %MEM  TIME+  COMMAND           
 1363 root      17   0   880    876   708   R    2.0      0.5       0:00.02 top               
    1    root      17   0   488    488   436   S    0.0      0.3       0:04.07 init             
    2    root      17   0     0      0       0       S    0.0      0.0       0:00.00 keventd           
    3    root      17   0     0      0       0       S    0.0      0.0       0:00.00 kapmd             
    4    root      36  19     0     0       0       S    0.0      0.0       0:00.00 ksoftirqd_CPU0   
    5    root      23   0     0      0       0       S    0.0      0.0       0:00.00 kswapd           
    6    root      23   0     0      0       0       S    0.0      0.0       0:00.00 bdflush           
    7    root      17   0     0      0       0       S    0.0      0.0       0:00.00 kupdated         
    9    root      17   0     0      0       0       S    0.0      0.0       0:00.00 kreiserfsd       
  152  root      17   0   832    832   592   S    0.0      0.4       0:00.04 devfsd           
  356  root      17   0     0      0       0       S    0.0      0.0       0:00.00 khubd             
  826  root      17   0   648    648   548   S    0.0      0.3       0:00.01 metalog           
  827  root      17   0   532    532   468   S    0.0      0.3       0:00.00 metalog           
 1278 root      17   0  1392   1392 1256 S    0.0      0.7       0:00.86 sshd             
 1309 root      17   0   640    640   548   S    0.0      0.3       0:00.01 cron             
 1322 root      18   0  1132   1132 960   S    0.0      0.6       0:00.01 bash             
 1323 root      17   0   656    656   576   S    0.0      0.3       0:00.00 agetty           
 1324 root      17   0   656    656   576   S    0.0      0.3       0:00.01 agetty           
 1325 root      17   0   656    656   576   S    0.0      0.3       0:00.00 agetty           
 1326 root      17   0   656    656   576   S    0.0      0.3       0:00.00 agetty           
 1327 root      17   0   656    656   576   S    0.0      0.3       0:00.01 agetty           
 1328 root      17   0  1700   1700 1508 S    0.0      0.9       0:00.03 sshd             
 1330 root      18   0  1332   1332 1128 S    0.0      0.7       0:00.03 bash

Does 43 Mb of RAM sound a little rediculous for what all is running and with only about 7 minutes of up time? or is that just me.

Anyone got any ideas where all that memory is going?


Last edited by jcpunk on Thu Jan 15, 2004 4:56 am; edited 1 time in total
Back to top
View user's profile Send private message
jmz2
Guru
Guru


Joined: 13 Jan 2004
Posts: 421
Location: Finland

PostPosted: Wed Jan 14, 2004 7:08 pm    Post subject: Reply with quote

You seldom see free (as in not used) memory with Linux. The kernel uses much of the memory for filesystem caching -- this memory is freed to applications when they require memory.

If you're worried about memory usage, you can save a bit of it by not loading GLX modules in XFree, using zsh (or some other lightweight shell) as your default shell, and by picking applications which don't demand so much resources.
Back to top
View user's profile Send private message
jcpunk
n00b
n00b


Joined: 22 Jul 2003
Posts: 37

PostPosted: Wed Jan 14, 2004 11:10 pm    Post subject: Reply with quote

While I agree that not loading parts of X (graphics acceleration and additional sessions) as well as using a lighter weight shell would save memory, I find it difficult to believe that my system which is not running X (so not loading GLX is already being taken care of, by not loading any part of X) and only running bash, sshd, and top should need to take up 43 Mb of memory.

Yes linux does buffer things but the quantity of memory being used seems rather rediculous for these programs and top records a buffer of only around 2Mb in use.

I am currently on a debian box running X, mozilla, xmms, gaim, and a few dozen other programs utilizing around 75Mb of RAM this seems much more reasonible, because SOMETHING is actually running on the computer. The gentool box has 4 processes that arnt recorded as sleeping when I run top, and none of them should be all that memory intensive.
Back to top
View user's profile Send private message
jmz2
Guru
Guru


Joined: 13 Jan 2004
Posts: 421
Location: Finland

PostPosted: Thu Jan 15, 2004 7:40 am    Post subject: Reply with quote

jcpunk wrote:
While I agree that not loading parts of X (graphics acceleration and additional sessions) as well as using a lighter weight shell would save memory, I find it difficult to believe that my system which is not running X (so not loading GLX is already being taken care of, by not loading any part of X) and only running bash, sshd, and top should need to take up 43 Mb of memory....I am currently on a debian box running X, mozilla, xmms, gaim, and a few dozen other programs utilizing around 75Mb of RAM this seems much more reasonible, because SOMETHING is actually running on the computer. The gentool box has 4 processes that arnt recorded as sleeping when I run top, and none of them should be all that memory intensive.


You missed the 18 MB of kernel caches. That plus the 2 MB of buffers totals 20 MB. So your kernel and programs are using 23 MB of memory. You can tune this by modularizing the kernel and loading modules as necessary. If you do not run X, then you may want to drop your graphics accelerator from the kernel configuration.

Metalog caches log files. If you choose some other system logger, you'd save a bit of memory there too. And if you want to really tune the system, you can change agettys to fgettys for example :)

But the point here is, your system's memory usage is far from ridiculous.
Back to top
View user's profile Send private message
jcpunk
n00b
n00b


Joined: 22 Jul 2003
Posts: 37

PostPosted: Thu Jan 15, 2004 8:44 pm    Post subject: Reply with quote

cool, thanks for the info... the memory usage still seems a bit high, but at least there is an explination.
Back to top
View user's profile Send private message
jmz2
Guru
Guru


Joined: 13 Jan 2004
Posts: 421
Location: Finland

PostPosted: Thu Jan 15, 2004 8:55 pm    Post subject: Reply with quote

For your amusement, you can check out other memory footprint reducing options, like those present in the 2.6 kernel (remove kernel features, somewhere in menuconfig, don't remember where it was), and dietlibc. Dietlibc is in Portage. I don't recommend trying them out unless you know what you're doing (or want to experiment).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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