Re: memory in 2.0

Stephen C. Tweedie (sct@dcs.ed.ac.uk)
Sat, 29 Jun 1996 11:46:04 +0100


Hi,

On Fri, 28 Jun 1996 20:56:25 -0400, "Sheldon E. Newhouse"
<sen@math.msu.edu> said:

> I have been happily running 2.0 for about three weeks now. No crashes,
> etc. But, the memory use of processes seems to be very high.

It's not all that bad!

> e.g. top reports that
> 705 lamm1 5 0 19432 19432 3648 S 304 4.8 20.3 5:15 netscape_3
> 222 root 11 0 10788 10788 672 R 0 5.2 11.3 5:02 Xaccel-elf
> 476 sen1 0 0 7480 7480 2996 S 300 0.0 7.8 1:48 netscape_3
> 2772 sen 0 0 3088 3088 1812 S 0 0.1 3.2 0:01 emacs
> 232 sen 0 0 1512 1512 1100 S 0 0.0 1.5 0:00 xload
> 380 root 0 0 1512 1512 1032 S 0 0.0 1.5 0:01 xterm
> 2776 root 0 0 1500 1500 1028 S 0 0.0 1.5 0:01 xterm

Try doing "ps -amx". The "-m" gives a fuller memory display for each
process. Here's a snapshot of mine:

PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT COMMAND
277 ? 376 48 60 1520 1580 0 1580 1164 0 101 xload -geo
260 ? 692 513 112 1468 1580 0 1580 1016 0 141 xterm -ls
304 ? 304 144 104 1488 1592 0 1592 1036 0 139 xterm
278 ? 311 149 112 1500 1612 0 1612 1048 0 141 xterm -geo
275 ? 399 70 44 1668 1712 0 1712 1220 0 123 /usr/local
237 ? 699 906 1000 4064 5064 0 5064 1264 0 918 /usr/X11R6
297 ? 2311 12713 1820 6720 8540 0 8540 2100 0 1609 emacs

> Do xterms really take 1.5 MB each? What about xload?

The xterms have got 1.5MB of pages mapped into their address spaces,
but two thirds of that is just binary and library code from the X
stuff, and is shared between all existing xterms in memory. The
library code indeed is shared between all running X apps. We're left
with maybe 512K per xterm of local data, and on my machine that's
largely because I've got xterm configured to maintain a large
scrollback buffer (1000 lines).

> Is netscape really using 19 MB?

I wouldn't be slightly surprised. :)

> I have 96 MB of RAM now, but if the above indicators are true, then I
> pity the people with small amounts of RAM.

As soon as you start to swap, a lot of the process' pages will get
swapped out. There's quite a bit of startup code involved with an X
app, and the actual running part of the code will be much smaller.
For what it's worth, Linux under X is quite responsive even on an 8MB
machine.

Cheers,
Stephen.

--
Stephen Tweedie <sct@dcs.ed.ac.uk>
Department of Computer Science, Edinburgh University, Scotland.