From: pss1@kepler.unh.edu (Paul S Secinaro)
Newsgroups: comp.sys.amiga.advocacy
Subject: Re: CBM mention on 12/11/92 Computer Chronicles
Date: 6 Jan 1993 15:58:10 GMT
Organization: University of New Hampshire  -  Durham, NH
NNTP-Posting-Host: kepler.unh.edu

>>How thick of you.  You act as if we haven't.  I'd advise you to use
>>the systems that have VM a little more.  Remove everything except the
>>minimum configuration of ram, and you'll see just what VM can do when
>>you load it with activity.  Even if you only get light to moderate use
>>of your VM, ANY swap can cripple performance.

>  Anyone who's had the pleasure of using OS/2 on a machine with 4Meg of
>ram (and again with 8Meg or more) knows full well how much of a performance
>penalty VM is.

*Sigh* I get the impression that everyone here thinks that VM is
supposed to be used as a *replacement* for real RAM.  It isn't.  If
you have an application that absolutely needs 8MB of real RAM, and you
only have 4MB, then VM isn't going to save you.  I hope everyone
understands this.

What VM might do, in a multiprogram environment, is free up enough RAM
from other jobs so that your program that needs 8MB might be able to
get it.  The rationale is that, on average, many of those other jobs
won't be using a large part of their allotted memory at any given
time.  It's the same rationale that CPU and disk caches operate under,
and I don't hear anyone bitching about them.  It's simply a way of
efficiently managing the allocation of a scarce resource.  Think of
physical RAM as a big cache for your virtual address space(s).

Obviously, if one or more programs have working sets larger than real
memory, you are going to have a problem.  This is no worse than a
system without VM, which will refuse to run the program in the first
place.  But this is a worst-case situation.  The whole point of
demand-paged VM, IMHO, is that you try to save some money by betting
that worst-cases won't show up too often.  If they do, you need more
memory, just like if you didn't have VM in the first place.

One nice thing about VM is that it takes away some of the workload
from the programmer, at the expense of some performance.  No need to
worry about overlays and such, for example - it's all managed by the
OS.

I see it as sort of like the argument about cooperative vs.
preemptive multitasking.  In cooperative multitasking, each process
must manage its usage of the CPU resource.  Some may do it well and
others poorly.  On the other hand, if you have a well-designed
preemptive system, all programs benefit automatically, at the expense
of some overhead for context-switching.

Going with this analogy, overlays would fall in the same category as
cooperative multitasking.  Each program can manage its own memory
resource usage for optimum performance.  But some programs will do it
well and others badly.  If you leave it up to the OS programmers, then
someone just has to write the demand paging code once (and do a good
job of it), and all programs will benefit, at the expense of some
performance.

Paul
-- 
Paul Secinaro
pss1@kepler.unh.edu
Synthetic Vision and Pattern Analysis Laboratory
UNH Dept. of Electrical and Computer Engineering