Print

Print


> I see the problem.  You have the definition of virtual memory wrong.
> Virtual memory is strictly a software concept, and has nothing to
> do with physical memory, which generally consists of RAM + swap.

I belive that YOU have the definition of virtual memory wrong.

> To quote from Tanenbaum, "Modern Operating Systems":

>	   The basic idea behind virtual memory is that the
>	   combined size of the program, data and stack may exceed
>	   the amount of physical memory available for it.

In this case, Tanenbaum uses the term "physical memory" to refer to
RAM, not RAM+swap.  This is obvious, because no process can have the
combined sizes of it's program, data, and stack exceed RAM+swap.  In
fact, the combined sizes of ALL RUNNING PROCESSES must be less than
RAM+swap.

Tanenbaum's sentence does not define virtual memory, but only gives
"the basic idea behind" it.  Now, the 5th edition of Doctor Linux,
Part XIII, 7.1 Making Virtual Memory, says: "To create an additional 8
megs of virtual memory..." and then shows how to make a swap file.
The 8 megs of swap space is the virtual memory.  Virtual memory is NOT
the 4 gigs of "addressable memory."

One can fragment the 4 gigs of addressable memory, but that would take
a lot of work.  The OS will move data in RAM and swap (a.k.a. "virtual
memory"), as needed.  So if two megs of RAM+swap are available, but
only in 512k blocks, and a process tries to allocate another meg, the
OS can move the data around in RAM+swap to make a contiguous 1 meg
block.

That is why we programmers don't have to worry about fragmenting
memory, until we reach the 4 gig limit.  The OS writers have already
solved the problem.

> If you still disagree, I suggest we take the discussion off-line.

Only if _I_ get the last word _online_.  :-)

-jack


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%