[842] in SIPB bug reports
Re: Memory Question & Latex
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Jan 12 14:36:44 1990
Date: Fri, 12 Jan 90 14:36:27 -0500
From: Theodore Ts'o <tytso@ATHENA.MIT.EDU>
To: dtaylor@ATHENA.MIT.EDU
Cc: bug-sipb@ATHENA.MIT.EDU
In-Reply-To: Darrin Taylor's message of Fri, 12 Jan 90 14:03:28 EST,
Reply-To: tytso@ATHENA.MIT.EDU
You're quite correct; if LaTeX hangs like that (and there aren't any
fileservers that are down), it probably because it has run out of
memory. Here's a quick lesson in swap space management: each
workstation has between 3-5 megabytes of physical memory. However, all
public workstations have 16 megabytes of virtual memory available to
them. How this magic is accomplished is by having 16 megabytes of "swap
space" available on disk. When a process is running, if it accesses a
bit of memory that is not currently located in physical memory, Unix
"swaps out" some memory that that isn't been currently being used,
copies it out to the disk, and "swaps in" the memory that is required by
copying it from disk into memory.
If you want to see how much virtual memory you have available, you can
use the "pstat -s" command:
athena% pstat -s
12404k used (2351k text), 3516k free, 3004k wasted, 544k missing
avail: 5*512k 1*256k 2*128k 2*64k 4*32k 6*16k 92*1k
The number that is important is the "3516k free". This shows that there
is currently 3.5 megabytes of free swap space on my machine. If you
want to see how much space your processes are taking up, do a "ps ux":
athena% ps ux
USER PID %CPU %MEM SZ RSS TT STAT TIME COMMAND
tytso 3402 18.9 15.3 1093 569 p1 R 2:37 (emacs)
tytso 3419 1.7 5.8 371 212 ? S 0:30 (zwgc)
tytso 3425 0.3 1.8 207 59 p1 S 0:07 (uwm)
tytso 3362 0.2 2.0 270 69 p1 S 0:10 -csh (csh)
tytso 3467 0.0 15.3 3224 551 p3 I 0:02 (virtex)
The two columns that are important here are the SZ and RSS size. The SZ
size represents the amount of memory that the process actually takes up.
The RSS represents how much of the process's memory is actually loaded
into the physcial memory. You'll notice that the RSS of processes that
are just idling is close to zero, which means that they've been swapped
out to disk to make room for the processes that are actually doing work.
So you can see that uwm takes up about 207k, and latex (which shows up
as virtex in the ps listing) takes up about 3.2 meg. My emacs is
process is a bit on the large size, since I start one up when I login
and never exit it until I logout --- it's about a meg.
I hope this helps you out. If you have any further questions about how
Unix's memory management works, please send them to me
(tytso@athena.mit.edu).
- Ted
P.S. I'm told that mwm takes about a meg of memory; if the number of
processes that you run is close to the 16 megabyte limit, the extra
memory consumed by mwm might have made a difference.