Memory usage (avoid swapping, top accuracy...)
Hi,
I'd like to have some information about memory usage and how to
improve it.
First, I have a PowerBook under Debian, with 256 MB RAM (physical
memory) and 512 MB swap. As this machine often swaps, I did some
tests, doing the sum Mem used + Swap used with the "top" command:
Booting and logging in ... 184 MB (main daemons + apache2 + innd + spamd)
Stopping spamd daemon .... 148 MB
Starting X (Xorg) ........ 231 MB (fvwm2 + ROX-Filer + Liferea + 3 xterm)
Exec emacs / quit ........ 241 MB
Firefox with 28 tabs ..... 251 MB
Exec emacs / quit ........ 247 MB
I'd like to know if all these figures seem to be normal. Well,
I assume that one can't deduce very much concerning memory that
can be required when using applications, due to the fact that
some parts of the program code are not taken into account. Are
there other good tools to analyze the memory usage?
Also, after using some programs taking a lot of memory, like dpkg
(possibly via apt-get), all the other programs data are swapped
out, and simple operations such as making a menu appear can take
several dozens of seconds. Is there a way to improve that, e.g.
by limiting the physical memory used (if possible under a 2.6.x
kernel)?
I've also looked at another machine (remotely), this time under x86,
and here's the output of "top", with processes ordered by memory
usage. The total memory used (1747944k) really seems to be strange.
top - 16:41:20 up 7 days, 5:59, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 67 total, 2 running, 65 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0% us, 0.0% sy, 0.0% ni, 100.0% id, 0.0% wa, 0.0% hi, 0.0% si
Mem: 2066448k total, 1747944k used, 318504k free, 330296k buffers
Swap: 2096472k total, 0k used, 2096472k free, 913808k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26338 vlefevre 16 0 56568 51m 2072 S 0.0 2.5 0:31.93 mutt
1265 root 21 5 27308 24m 2068 S 0.0 1.2 0:00.53 spamd
1537 root 21 5 27308 22m 604 S 0.0 1.1 0:00.00 spamd
1538 root 21 5 27308 22m 524 S 0.0 1.1 0:00.00 spamd
1539 dictd 17 0 46788 10m 9080 S 0.0 0.5 0:00.03 dictd
2083 vlefevre 16 0 11128 6776 2944 S 0.0 0.3 0:01.79 mutt
1679 root 18 0 12960 4504 1124 S 0.0 0.2 0:00.10 Xprt
27446 root 16 0 11304 3796 1812 S 0.0 0.2 0:00.00 apache2
1774 ntp 16 0 3584 3584 2916 S 0.0 0.2 0:00.01 ntpd
13835 vlefevre 16 0 6812 3264 1636 S 0.0 0.2 0:00.32 zsh
26279 vlefevre 16 0 6716 3252 1652 S 0.0 0.2 0:00.07 zsh
27449 www-data 23 0 11440 3056 1044 S 0.0 0.1 0:00.00 apache2
27450 www-data 17 0 11440 3056 1044 S 0.0 0.1 0:00.00 apache2
27451 www-data 21 0 11440 3056 1044 S 0.0 0.1 0:00.00 apache2
27452 www-data 18 0 11440 3056 1044 S 0.0 0.1 0:00.00 apache2
27453 www-data 15 0 11440 3056 1044 S 0.0 0.1 0:00.00 apache2
1234 bind 18 0 29952 2568 1732 S 0.0 0.1 0:00.01 named
13832 root 15 0 7368 2488 2052 S 0.0 0.1 0:00.01 sshd
13834 vlefevre 16 0 7528 1600 1144 R 0.0 0.1 0:00.00 sshd
2082 vlefevre 16 0 5244 1572 728 S 0.0 0.1 0:00.85 screen
1224 root 15 0 2476 1356 372 S 0.0 0.1 0:00.04 klogd
1595 daemon 16 0 4704 1288 884 S 0.0 0.1 0:00.06 lpd
1398 root 16 0 2228 1200 664 S 0.0 0.1 0:00.08 automount
1454 root 16 0 2224 1184 664 S 0.0 0.1 0:00.00 automount
1526 root 16 0 2136 1084 580 S 0.0 0.1 0:00.00 automount
[...]
--
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
Reply to: