* Swap space full problems
@ 1994-02-01 22:38 Don Katz
1994-02-02 17:26 ` Darcy Semeniuk
0 siblings, 1 reply; 12+ messages in thread
From: Don Katz @ 1994-02-01 22:38 UTC (permalink / raw)
A new alpha osf/1 machine I am supporting has 64 Mb of RAM and 134 Mb
of swap. It is running OSF/1 V1.3 REV. 111, and has been up 32 days.
It consistently reports "swap space below 10 percent free". The
primary user runs Matlab, often several processes at a time, each of
which takes 15-20 Mb of virtual memory. But the processes which are
taking the most virtual memory (as reported by ps) are /usr/lib/X11/X
(64M) and the kernel.
% ps -eO vsize | grep M | sort -bnr +1
swap space below 10 percent free
0 222M R < ?? 29583:20.14 [kernel idle]
237 63.9M S ?? 27:39.44 /usr/bin/X11/X -auth /usr/lib/X11/xdm/A:0-000233
10219 17.0M R p1 1960:20.95 /usr/misc/matlab/bin/alpha/matlab
10254 12.2M S p2 0:01.83 /usr/misc/matlab/bin/alpha/matlab
9848 10.6M I + p3 0:03.56 /usr/misc/matlab/bin/alpha/matlab
9009 9.47M S ?? 6:33.47 /usr/bin/X11/dxterm -ls
8959 9.47M I ?? 1:25.27 /usr/bin/X11/dxterm -ls
8889 8.16M I ?? 1:09.05 /usr/bin/X11/mwm
8871 7.98M I ?? 0:00.31 -:0 (xdm)
233 7.63M I ?? 0:00.46 /usr/bin/X11/xdm -config /usr/lib/X11/xdm/xdm-co
8886 7.36M I ?? 0:00.86 dxsession
Can I conclude from this output that X is the problem? If so, how can
I reduce the amount of virtual memory taken up by X, or is there an
alternative display manager that is less resource intensive? Is this
an uptime problem, i.e. does X increase its virtual memory use with
time?
Finally, is there a better tool or method of determining what
processes are filling up the swap space?
Don
P.S. Our news server has some problems at the moment, so please copy
replies to me by email, so I can be sure to receive them.
-----------------------------------------------------------------------------
Don Katz, Ph.D . Physical
.- / \ -. Sciences
University of Wisconsin - Madison ./' /+-+\ `\. Laboratory E-MAIL
3725 Schneider Drive /' /-+-+-\ `\ ------
Stoughton, WI 53589 // /+-+-+-+\ \\ psl::dbk
<======| P S L |======> dbk@psl.wisc.edu
Phone: 608-877-2242 (FAX: -2201) +---------+ dbk@wiscpsl.bitnet
-------------------------------------------------------------------------------
--
-----------------------------------------------------------------------------
Don Katz, Ph.D . Physical
.- / \ -. Sciences
University of Wisconsin - Madison ./' /+-+\ `\. Laboratory E-MAIL
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-01 22:38 Swap space full problems Don Katz
@ 1994-02-02 17:26 ` Darcy Semeniuk
[not found] ` <2iq2od$l3f@scratchy.reed.edu>
0 siblings, 1 reply; 12+ messages in thread
From: Darcy Semeniuk @ 1994-02-02 17:26 UTC (permalink / raw)
Don Katz (dbk@pslu1.psl.wisc.edu) wrote:
: A new alpha osf/1 machine I am supporting has 64 Mb of RAM and 134 Mb
: of swap. It is running OSF/1 V1.3 REV. 111, and has been up 32 days.
: It consistently reports "swap space below 10 percent free". The
: primary user runs Matlab, often several processes at a time, each of
: which takes 15-20 Mb of virtual memory. But the processes which are
: taking the most virtual memory (as reported by ps) are /usr/lib/X11/X
: (64M) and the kernel.
: % ps -eO vsize | grep M | sort -bnr +1
: swap space below 10 percent free
: 0 222M R < ?? 29583:20.14 [kernel idle]
: 237 63.9M S ?? 27:39.44 /usr/bin/X11/X -auth /usr/lib/X11/xdm/A:0-000233
: 10219 17.0M R p1 1960:20.95 /usr/misc/matlab/bin/alpha/matlab
: 10254 12.2M S p2 0:01.83 /usr/misc/matlab/bin/alpha/matlab
: 9848 10.6M I + p3 0:03.56 /usr/misc/matlab/bin/alpha/matlab
: 9009 9.47M S ?? 6:33.47 /usr/bin/X11/dxterm -ls
: 8959 9.47M I ?? 1:25.27 /usr/bin/X11/dxterm -ls
: 8889 8.16M I ?? 1:09.05 /usr/bin/X11/mwm
: 8871 7.98M I ?? 0:00.31 -:0 (xdm)
: 233 7.63M I ?? 0:00.46 /usr/bin/X11/xdm -config /usr/lib/X11/xdm/xdm-co
: -----------------------------------------------------------------------------
: Don Katz, Ph.D . Physical
: .- / \ -. Sciences
: University of Wisconsin - Madison ./' /+-+\ `\. Laboratory E-MAIL
: 3725 Schneider Drive /' /-+-+-\ `\ ------
: Stoughton, WI 53589 // /+-+-+-+\ \\ psl::dbk
: <======| P S L |======> dbk@psl.wisc.edu
: Phone: 608-877-2242 (FAX: -2201) +---------+ dbk@wiscpsl.bitnet
: -------------------------------------------------------------------------------
Your kernel is about the right size, but your X server is way too large
(Mine is 10M right now). You should add the following lines to your
xdm-config file:
DisplayManager._0.terminateServer: true
DisplayManager.local_0.terminateServer: true
This will cause your Xserver to terminate and restart every time you log
out - which stops the upward creaping memory usage.
Darcy
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
[not found] ` <2iq2od$l3f@scratchy.reed.edu>
@ 1994-02-11 19:00 ` Andy Brown
1994-02-11 19:49 ` System Janitor
1994-02-12 0:41 ` Gail L. Grant
0 siblings, 2 replies; 12+ messages in thread
From: Andy Brown @ 1994-02-11 19:00 UTC (permalink / raw)
In article <2iq2od$l3f@scratchy.reed.edu>, brown@reed.edu (C. Titus Brown) writes:
|> Path: decuk.uvo.dec.com!crl.dec.com!crl.dec.com!decwrl!decwrl!koriel!lll-winken.llnl.gov!sundance.llnl.gov!fastrac.llnl.gov!usenet.ee.pdx.edu!news.reed.edu!usenet
|> From: brown@reed.edu (C. Titus Brown)
|> Newsgroups: comp.unix.osf.osf1
|> Subject: Re: Swap space full problems
|> Date: Thu, 3 Feb 94 06:40:29 BST
|> Organization: Reed College, Portland, Oregon
|> Lines: 28
|> Message-ID: <2iq2od$l3f@scratchy.reed.edu>
|> References: <1994Feb1.223800.13903@pslu1.psl.wisc.edu> <5042@sparky.mdavcr.mda.ca>
|> NNTP-Posting-Host: reed.edu
|>
|> Yes, that will help. The other thing to do (to get rid of the 10% full
|> message) is to put it into over-commitment mode. Remove /sbin/swapdefault
|> (it's a link to somewhere) and reboot the machine.
|>
|> This is documented somewhere in the system administrators manual.
|>
|> --Titus
|>
a) Its a link to your primary swap device
b) Putting it into over-commit mode will not solve the problem; The "swap below
10% free" message will disappear, but you will simply find that processes
start disappearing for no reason.
Better to cure the problem that to ignore it!:-)
---
Andy Brown
- If I'm talking nonsense, don't blame me, DEC or anyone else.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-11 19:00 ` Andy Brown
@ 1994-02-11 19:49 ` System Janitor
1994-02-12 0:41 ` Gail L. Grant
1 sibling, 0 replies; 12+ messages in thread
From: System Janitor @ 1994-02-11 19:49 UTC (permalink / raw)
brown@mco.dec.com (Andy Brown) writes:
>a) Its a link to your primary swap device
>b) Putting it into over-commit mode will not solve the problem; The "swap below
> 10% free" message will disappear, but you will simply find that processes
> start disappearing for no reason.
Unless I wasn't interpreting the output of kdbx rightly, my box
was spewing out the warning message when the primary swap partition
was mostly full, ignoring the fact that there was a nearly empty
secondary swap partition that was even bigger than the primary.
Getting rid of the link *did* solve my problem.
-Mike
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-11 19:00 ` Andy Brown
1994-02-11 19:49 ` System Janitor
@ 1994-02-12 0:41 ` Gail L. Grant
1994-02-16 23:04 ` Andrew Rutherford
1 sibling, 1 reply; 12+ messages in thread
From: Gail L. Grant @ 1994-02-12 0:41 UTC (permalink / raw)
In article <2jgkk3$pqd@decuk.uvo.dec.com>, brown@mco.dec.com (Andy Brown) writes:
|>In article <2iq2od$l3f@scratchy.reed.edu>, brown@reed.edu (C. Titus Brown) writes:
|>|> Yes, that will help. The other thing to do (to get rid of the 10% full
|>|> message) is to put it into over-commitment mode. Remove /sbin/swapdefault
|>|> (it's a link to somewhere) and reboot the machine.
|>|>
|>|> This is documented somewhere in the system administrators manual.
|>|>
|>|> --Titus
|>|>
|>
|>a) Its a link to your primary swap device
|>b) Putting it into over-commit mode will not solve the problem; The "swap below
|> 10% free" message will disappear, but you will simply find that processes
|> start disappearing for no reason.
not what we have seen. most apps ask for far more memory than they ever use.
for us, changing to lazy HAS solved the problem. the only side effect that
we have found with this is that if a user has a runaway process, the system
hangs. has happened two times in six months and on a demo machine where folk
are really banging on it, i think that pretty good.
i say it below, but this is MY experience/opinion, not official Digital policy.
g.
--
============================================================================
Gail L. Grant - "Live free or WISH you had" - (415)853-6564 grant@pa.dec.com
WORK phone #
Opinions expressed are my own, OBVIOUSLY not those of my employer.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
@ 1994-02-14 19:41 Don Katz
1994-02-15 16:13 ` hooft
0 siblings, 1 reply; 12+ messages in thread
From: Don Katz @ 1994-02-14 19:41 UTC (permalink / raw)
Summary of responses:
I (dbk@pslu1.psl.wisc.edu) wrote:
: A new alpha osf/1 machine I am supporting has 64 Mb of RAM and 134 Mb
: of swap. It is running OSF/1 V1.3 REV. 111, and has been up 32 days.
: It consistently reports "swap space below 10 percent free". The
: primary user runs Matlab, often several processes at a time, each of
: which takes 15-20 Mb of virtual memory. But the processes which are
: taking the most virtual memory (as reported by ps) are /usr/lib/X11/X
: (64M) and the kernel.
: % ps -eO vsize | grep M | sort -bnr +1
: swap space below 10 percent free
: 0 222M R < ?? 29583:20.14 [kernel idle]
: 237 63.9M S ?? 27:39.44 /usr/bin/X11/X -auth /usr/lib/X11/xdm/A:0-0002
33
: 10219 17.0M R p1 1960:20.95 /usr/misc/matlab/bin/alpha/matlab
: 10254 12.2M S p2 0:01.83 /usr/misc/matlab/bin/alpha/matlab
: 9848 10.6M I + p3 0:03.56 /usr/misc/matlab/bin/alpha/matlab
: 9009 9.47M S ?? 6:33.47 /usr/bin/X11/dxterm -ls
: 8959 9.47M I ?? 1:25.27 /usr/bin/X11/dxterm -ls
: 8889 8.16M I ?? 1:09.05 /usr/bin/X11/mwm
: 8871 7.98M I ?? 0:00.31 -:0 (xdm)
: 233 7.63M I ?? 0:00.46 /usr/bin/X11/xdm -config /usr/lib/X11/xdm/xdm-
co
*****First, two different ways of terminating the X process with each logout**
From: joerg@itap.physik.uni-stuttgart.de (Joerg Stadler)
I'd the same trouble with our machine, there is probably a memory leak
in the X-server. Just change
/usr/lib/X11/xdm/Xservers
so that the line starting up /usr/bin/X11/X reads
:0 local /usr/bin/X11/X -terminate
The -termiate option will restart the X-server for every session, so
it stops eating more and more memory.
From: Dr Marco Luchini <m.luchini@ic.ac.uk>
you might want to add the line:
DisplayManager._0.terminateServer: true
to your xdm-config to ensure the server gets killed at session exit and
the new session gets a new server. Memory leaks shouldn't happen but
they do. Also servers can get large if somebody views a lot of piccies.
You may also want to switch to 'lazy' swap if you run into this problem
a lot. We do.
From: das@mdavcr.mda.ca (Darcy Semeniuk)
Your kernel is about the right size, but your X server is way too large
(Mine is 10M right now). You should add the following lines to your
xdm-config file:
DisplayManager._0.terminateServer: true
DisplayManager.local_0.terminateServer: true
This will cause your Xserver to terminate and restart every time you log
out - which stops the upward creaping memory usage.
***** The other option is to switch to lazy swap *****
From: brown@reed.edu (C. Titus Brown)
>Your kernel is about the right size, but your X server is way too large
>(Mine is 10M right now).
[fix removed]
Yes, that will help. The other thing to do (to get rid of the 10% full
message) is to put it into over-commitment mode. Remove /sbin/swapdefault
(it's a link to somewhere) and reboot the machine.
This is documented somewhere in the system administrators manual.
From: brown@mco.dec.com (Andy Brown)
(re: /sbin/swapdefault)
a) Its a link to your primary swap device
b) Putting it into over-commit mode will not solve the problem; The "swap below
10% free" message will disappear, but you will simply find that processes
start disappearing for no reason.
Better to cure the problem that to ignore it!:-)
From: grant@glg.pa.dec.com (Gail L. Grant)
not what we have seen. most apps ask for far more memory than they ever use.
for us, changing to lazy HAS solved the problem. the only side effect that
we have found with this is that if a user has a runaway process, the system
hangs. has happened two times in six months and on a demo machine where folk
are really banging on it, i think that pretty good.
i say it below, but this is MY experience/opinion, not official Digital policy.
From: Dr Marco Luchini <m.luchini@ic.ac.uk>
The following is the "official" line wrt 'lazy' vs 'eager' swap.
As a postscript I should add that it is somwhat pessimistic. I've been
running 3 alphas for a year like that in an active research environment
and had no probs. Just make sure that you sit hard on people who start
a 50Mb job without checking that there is space. Shaming them by
pointing out that they are screwing everybody else up usually works
wonders.
Regarding Jim's comment on what process gets killed, my understanding,
borne out in practice, is that the process to ask for more swap gets
killed. Generally this is the shell with which you've just logged in
because things were becoming slow and were about to solve the problem.
I keep an old window always open on my server just in case. Old shells
never get killed.
The way you turn on lazy swap is
# mv /sbin/swapdefault /sbin/swapdefault-
# reboot
To go back to eager:
# mv /sbin/swapdefault- /sbin/swapdefault
# reboot
See Chapter 7 of the system and admin guide.
Ciao, Marco
In article <2gh6ah$gkq@quabbin.crl.dec.com>, jg@crl.dec.com (Jim Gettys) writes
:
|> Immediate swap space allocation means that the system allocates
|> swap space on disk at the time the process allocates more VM;
|> if there are any problems, that process gets notified,
|> and possibly terminated (by default). This also means that the
|> total VM of all processes cannot exceed the available swap space.
|>
|> "Lazy" or "deferred" allocation means that swap space is allocated
|> at the time the system actually needs to use more main memory for
|> some process (i.e. decides it has to page something out). This
|> means that the total VM of all processes can equal the sum of
|> all available swap space + main memory. This results in less disk
|> required to support the processes; you only need the amount of disk
|> space that is required to hold the VM being paged out.
|>
|> The problem with "deferred" allocation is that at the time of allocation,
|> you don't know what process to penalize; the system must get memory
|> from somewhere (or would deadlock), so has to choose some process to
|> kill; and it isn't as smart as a person might be about what it chooses :-).
|>
|> So lazy or deferred allocation is most suitable on single user systems
|> where you are the only person that would be affected; on a multiuser system
|> it is pretty unfriendly to have to terminate someone else's process for
|> reasons outside of their control. And on production systems where you
|> want to guarantee that once a process starts, it will continue indefinately,
|> you'd better be using immediate allocation. This is why we ship our OSF
|> with immediate allocation by default.
|> - Jim
|>
|> --
|> Digital Equipment Corporation
|> Cambridge Research Laboratory
**** Finally, add more swap space if possible ****
From: Brian Saunders <saunders@luther.che.wisc.edu>
Not that its very helpful, but if you have the disk space to spare, I'd add
some more swap space, if I were you. We now have 324 MB for 64 MB RAM, and
have hardly any problems. Yes, that is overkill, but I think maintaining
at least a 3:1 swap ratio is key on these machines.
--
-----------------------------------------------------------------------------
Don Katz, Ph.D . Physical
.- / \ -. Sciences
University of Wisconsin - Madison ./' /+-+\ `\. Laboratory E-MAIL
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-14 19:41 Don Katz
@ 1994-02-15 16:13 ` hooft
0 siblings, 0 replies; 12+ messages in thread
From: hooft @ 1994-02-15 16:13 UTC (permalink / raw)
With all the discussions on eager swap mode for OSF/1 I started
wondering why every program for OSF/1 claims 8MB before it has
started. The only reason I can think of is that there is space
reserved in case a process writes to the shared library pages. If that
is correct (DEC?) there could probably be a reasonable intermediate
between eager and lazy swap, which does not allow Copy-On-Write for
textpages and thus saves about 8MB per process: just give a SIGSEGV
when a program tries to change text (this is probably already the
case).
Currently the system I'm using is running lazy swap, and since I have
used the linux operating system for a long time already, I'm used to
that. Some people, however, might prefer an earlier warning. The
earger swap is a bit overdone.
Any comments?
--
Rob W. W. Hooft, European Molecular Biology Laboratory, Meyerhofstr. 1, D-69117
Heidelberg, BRD. == hooft@EMBL-Heidelberg.DE == Use Linux! Free OS for 386/486!
========== GS -p+ c++ l++ u-(++) e+++ m++ s !n h+ f !g w+ t r !y ==============
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-12 0:41 ` Gail L. Grant
@ 1994-02-16 23:04 ` Andrew Rutherford
1994-02-17 19:27 ` Harry Mantakos
0 siblings, 1 reply; 12+ messages in thread
From: Andrew Rutherford @ 1994-02-16 23:04 UTC (permalink / raw)
Gail L. Grant (grant@glg.pa.dec.com) wrote:
: not what we have seen. most apps ask for far more memory than they ever use.
: for us, changing to lazy HAS solved the problem. the only side effect that
: we have found with this is that if a user has a runaway process, the system
: hangs. has happened two times in six months and on a demo machine where folk
: are really banging on it, i think that pretty good.
I'd go a step further - I had a problem with a runaway process
that occured simultaneously on two Alphas (triggered by a network problem,
but that's another story), and on one of them no-one had actually got
around to removing swapdefault first.
On the overcommit machine, it allocated more memory than existed,
tried writing to a page of it, and the kernel killed it. System returns
to normal after a five minute hang.
On the eager allocation machine, it chewed up all memory it could,
then the malloc's must have started failing, but it didn't die as a result
of it - we wouldn't have known what the problem was if not for the other
machine - the only way out was the panic button, as we couldn't run
anything else as there was no memory availible.
To the person (sorry, I've lost it) who said something to the
effect of "all it will do is make processes fall over", I've had it
explained to me/worked it out myself (so I could be wrong), that in
eager mode it's reserving pages for copy-on-write faults to the shared
libraries, which almost never happens. So it's reserving lots of
swap space that is never, ever, going to be used.
Andrew.
/*
* Andrew Rutherford andrewr@itd.adelaide.edu.au
* +61 8 303 5669 Real Programmers always confuse Christmas and
* Room 1060, Adelaide Uni Halloween because OCT 31 == DEC 25 !
*/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-16 23:04 ` Andrew Rutherford
@ 1994-02-17 19:27 ` Harry Mantakos
1994-02-18 5:54 ` Wuxu Peng
1994-02-24 7:17 ` Andrew Rutherford
0 siblings, 2 replies; 12+ messages in thread
From: Harry Mantakos @ 1994-02-17 19:27 UTC (permalink / raw)
In article <2ju8pj$qlg@huon.itd.adelaide.edu.au> andrewr@itd.adelaide.edu.au (Andrew Rutherford) writes:
> On the overcommit machine, it allocated more memory than existed,
>tried writing to a page of it, and the kernel killed it. System returns
>to normal after a five minute hang.
>
> On the eager allocation machine, it chewed up all memory it could,
>then the malloc's must have started failing, but it didn't die as a result
>of it - we wouldn't have known what the problem was if not for the other
>machine - the only way out was the panic button, as we couldn't run
>anything else as there was no memory availible.
I don't think this is a typical situation. The process on the second machine
should have exit()'ed after a failed malloc, sort of sounds like someone
didn't check a malloc() return value.
With the more traditional allocation scheme, swap is reserved as memory
is allocated, this insures that you will only run out of swap when memory
is being allocated, as in when a process is first starting up or when it
is doing a malloc(). With deferred swapping the system will honor requests
for any amount of virtual memory, and swap will be assigned only as those
allocated pages of memory are actually accessed.
Deferred swapping is more efficient, because pages that are never used
never take up any swap. However the system will make commitments for more
virtual memory than it actually has, and when it actually does run out of
swap, processes will fail on memory accesses rather than just on malloc,
or fork/exec.
To check this out, I turned on deferred swapping on an alpha here
(running OSF/1 V1.2) and ran a few instances of a process that malloc's
a 50 meg chunk, then goes through and touches each page one by one. With
80 meg of swap, the system cheerfully promised out 200 meg of virtual
memory. When the system started running out of swap (as the processes
started accessing their promised pages), the machine turned into a
battleground, my editor sessions croaked, shells quit, and windows started
disappearing. With deferred swapping turned off, the processes that were
eating up all the memory would have just failed on the malloc().
So, of course it's a trade-off. With deferred swapping you can use the swap
you have more efficiently (by never reserving swap for pages that never get
accessed). However things are uglier when you actually do run out of swap.
Processes get killed at "random" moments with no chance to exit gracefully
(and maybe clean up after themselves in some fashion). Also, since it
isn't the malloc()s that are failing, the processes that die aren't necessarily
even the ones eating up all the memory.
-harry
------------------------------------------------------------------------------
Spoken: Harry Mantakos Domain: harry@cs.umd.edu UUCP: uunet!mimsy!harry
Phone: 301-405-2750 USPS: U of Maryland, CS Dept., College Park, MD 20742
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-17 19:27 ` Harry Mantakos
@ 1994-02-18 5:54 ` Wuxu Peng
1994-02-22 11:00 ` anthony baxter
1994-02-24 7:17 ` Andrew Rutherford
1 sibling, 1 reply; 12+ messages in thread
From: Wuxu Peng @ 1994-02-18 5:54 UTC (permalink / raw)
I have been following all discussions about swapping problems
on DEC Alpha OSF1 because I have been burned several times
by the "swapping space below 10%" error message. I have seen
many arguments about the benefits and necessity of running the
kernel in eager mode. It seems that DEC is insisting on the
correctness of the swapping space allocation strategy.
I am not convinced about the correctness of Alpha's swapping
strategy at all. To me, there are bugs in it. For instance,
many times I had seen that a small shell script of ten lines
was allocated 1.2M swapping space on my machine. It doesn't
make any sense.
--
--wuxu peng (peng@pirates.cs.swt.edu)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-18 5:54 ` Wuxu Peng
@ 1994-02-22 11:00 ` anthony baxter
0 siblings, 0 replies; 12+ messages in thread
From: anthony baxter @ 1994-02-22 11:00 UTC (permalink / raw)
peng@pirates.cs.swt.edu (Wuxu Peng) writes:
>I am not convinced about the correctness of Alpha's swapping
>strategy at all. To me, there are bugs in it. For instance,
>many times I had seen that a small shell script of ten lines
>was allocated 1.2M swapping space on my machine. It doesn't
>make any sense.
Ummm, be careful. Under 1.2 and 1.3, the VSZ number from ps (and
from top, and from syd) includes the space taken by shared libraries.
When I was porting top, I found a way that I _think_ would have produced
a more accurate number under 1.2 and 1.3, but it looked like being fairly
icky, so I never bothered implementing it. From what I've seen, its fixed
in 2.0, anyway - the VSZ numbers from top are much more meaningful. (ps
calculates the number in a similar way, and so it will also give more
meaningful numbers.) (note that I'm not an employee of dec, I havent got
2.0, so take anything I say with a grain of salt, and pleeeease dont hit me
if 2.0 turns out to be different :)
And to try to prevent the flood of mail that arrives whenever I'm silly
enough to mention the t*p word,
ftp.eng.umd.edu:/pub/alpha/alpha-top-3.3beta.tar.gz
Anthony
--
anthony baxter @ /\/\|| |= Sarah McLachlan mailing =| australian artificial
email: anthony@aaii.oz.au |= list: mail fte-request@ =| intelligence institute
phone: +613 663 7922 |= yoyo.cc.monash.edu.au. =| 1 grattan st, carlton
Practice random kindness and senseless acts of sarcasm. australia 3053.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Swap space full problems
1994-02-17 19:27 ` Harry Mantakos
1994-02-18 5:54 ` Wuxu Peng
@ 1994-02-24 7:17 ` Andrew Rutherford
1 sibling, 0 replies; 12+ messages in thread
From: Andrew Rutherford @ 1994-02-24 7:17 UTC (permalink / raw)
In article <2ju8pj$qlg@huon.itd.adelaide.edu.au> I wrote:
+ On the overcommit machine, it allocated more memory than existed,
+ tried writing to a page of it, and the kernel killed it. System returns
+ to normal after a five minute hang.
+
+ On the eager allocation machine, it chewed up all memory it could,
+ then the malloc's must have started failing, but it didn't die as a result
+ of it - we wouldn't have known what the problem was if not for the other
+ machine - the only way out was the panic button, as we couldn't run
+ anything else as there was no memory availible.
In article <2k0gel$gkj@krishna.cs.umd.edu> Harry Mantakos wrote:
: I don't think this is a typical situation. The process on the second machine
: should have exit()'ed after a failed malloc, sort of sounds like someone
: didn't check a malloc() return value.
I know, it's a bug. In DEC's code, no less, but it's been long
fixed now. An SNMP agent that when queried by a specific machine went
rogue. The important thing was that the lazy swap machine recovered
from a runaway process while the eager alloaction machine didn't
recover, and it was that I was trying to demostrate, not the lousy
programming style of someone. After all, eventually someone is going to
make a mistake on your machine, and I'd like the machine to have some
chance of recovery.
: With the more traditional allocation scheme, swap is reserved as memory
: is allocated, this insures that you will only run out of swap when memory
: is being allocated, as in when a process is first starting up or when it
: is doing a malloc(). With deferred swapping the system will honor requests
: for any amount of virtual memory, and swap will be assigned only as those
: allocated pages of memory are actually accessed.
The point here is that it's reserving space for the shared
libraries, specifically the C shared library, since everyone uses it.
: To check this out, I turned on deferred swapping on an alpha here
: (running OSF/1 V1.2) and ran a few instances of a process that malloc's
: a 50 meg chunk, then goes through and touches each page one by one. With
: 80 meg of swap, the system cheerfully promised out 200 meg of virtual
: memory. When the system started running out of swap (as the processes
: started accessing their promised pages), the machine turned into a
: battleground, my editor sessions croaked, shells quit, and windows started
: disappearing. With deferred swapping turned off, the processes that were
: eating up all the memory would have just failed on the malloc().
Did you actually try it with eager allocation? I think you'd
find the machine ran just as slowly, it still has to do a _lot_ of
swapping (cf: run /usr/etc/chill on a SunOS machine and tell me how
fast the machine goes). I am suprised that your windows, etc, started
to vanish - one would think that only processes writing to memory they
hadn't already written to would be falling over, and in my experience
nothing else is actually doing anything when the critical swap space
point is reached with a runaway process, as the system is so busy
swapping. I must have been incredibily lucky, but I've only ever had the
runaway process die. I would expect any session's I'm actively doing
memory "intensive" things (ie, including a new file into the edit buffer)
at the time to die, but it hasn't actually happened to me yet. I probably
got saved by giving up and not fighting the system and just sitting back
and waiting for it to recover.
I'd also note that (1) a lot of the wierd behaviour of killing
things changed in the upgrade from 1.2 to 1.3, and (2) the two machines
I mentioned earlier weren't running either 1.2 or 1.3. :-)
: So, of course it's a trade-off. With deferred swapping you can use the swap
I agree, there is definatly a trade-off. You lose some of your
system security by going to lazy mode, but it does allow you to take the
machine well past where it would otherwise go. There are also specific,
limited cases with runaway programs where it lazy systems will recover
where eager systems won't, but in general it's just a different way
your machine gets screwed. :-)
Basically, I'd advocate lazy in all cases except absolute
guarantee required systems where development isn't taking place, in
which case eager is definatly the way to go.
Cya all,
Andrew.
/*
* Andrew Rutherford andrewr@iagu.itd.adelaide.edu
* +61 8 303 5669 Real Programmers always confuse Christmas and
* Room 1060, Adelaide Uni Halloween because OCT 31 == DEC 25 !
*/
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~1994-02-24 7:17 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-02-01 22:38 Swap space full problems Don Katz
1994-02-02 17:26 ` Darcy Semeniuk
[not found] ` <2iq2od$l3f@scratchy.reed.edu>
1994-02-11 19:00 ` Andy Brown
1994-02-11 19:49 ` System Janitor
1994-02-12 0:41 ` Gail L. Grant
1994-02-16 23:04 ` Andrew Rutherford
1994-02-17 19:27 ` Harry Mantakos
1994-02-18 5:54 ` Wuxu Peng
1994-02-22 11:00 ` anthony baxter
1994-02-24 7:17 ` Andrew Rutherford
-- strict thread matches above, loose matches on Subject: below --
1994-02-14 19:41 Don Katz
1994-02-15 16:13 ` hooft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox