[comp.sys.mac.system] Best way of doing VM?

philip@pescadero.Stanford.EDU (Philip Machanick) (05/30/91)

In article <1991May29.173052.17108@zardoz.eng.ohio-state.edu>,
gaynor@agvax2.ag.ohio-state.edu writes:
|> From this, it would appear that Virtual Memory, even in small
|> portions, would require -huge- amounts of disk space for those with
|> large amounts of RAM.

Minor point on terminology: virtual address space means the
whole thing, not just what is stored on disk. I don't know
why Apple has chosen to store the entire virtual address
space on disk - perhaps someone from Apple would care to
comment.

I can list a few possible reasons for doing this, but none
apply immediately (is Apple perhaps thinking ahead...?):

o mapping files to memory - this is a useful technique
  and is a relatively simple generalization if all of VM
  is stored on disk
o process migration - in a multiprocessor machine, it is
  relatively easy to move a process to another processor
  if all of VM is on disk
o it's easier to manage multiple address spaces on
  the same machine - you just allocate each exactly the
  amount of disk space needed for its VM
-- 
Philip Machanick
philip@pescadero.stanford.edu

peter@suntan.viewlogic.com (Peter Colby) (05/30/91)

In article <1991May29.201759.6433@neon.Stanford.EDU>, philip@pescadero.Stanford.EDU (Philip Machanick) writes:
|> In article <1991May29.173052.17108@zardoz.eng.ohio-state.edu>,
|> gaynor@agvax2.ag.ohio-state.edu writes:
|> |> From this, it would appear that Virtual Memory, even in small
|> |> portions, would require -huge- amounts of disk space for those with
|> |> large amounts of RAM.
|> 
|> Minor point on terminology: virtual address space means the
|> whole thing, not just what is stored on disk. I don't know
|> why Apple has chosen to store the entire virtual address
|> space on disk - perhaps someone from Apple would care to
|> comment.
|> 
|> I can list a few possible reasons for doing this, but none
|> apply immediately (is Apple perhaps thinking ahead...?):
|> 
|> o mapping files to memory - this is a useful technique
|>   and is a relatively simple generalization if all of VM
|>   is stored on disk
|> o process migration - in a multiprocessor machine, it is
|>   relatively easy to move a process to another processor
|>   if all of VM is on disk
|> o it's easier to manage multiple address spaces on
|>   the same machine - you just allocate each exactly the
|>   amount of disk space needed for its VM
|> -- 
|> Philip Machanick
|> philip@pescadero.stanford.edu

	Don't forget an even more germaine point. It is orders of magnitude
easier to only have to manage "in core" memory. If every time you page fault
you have to exchange disk and core memory (which is what you get if you ADD
physical to disk allocation to get virtual) you end up with a guarenteed 2
disk accesses instead of a ratio more in line with writes to total accesses.
PLUS, you have to maintain constantly changing page maps for the disk portion
of the memory in addition to the maps for physical memory.
	I have NEVER seen a virtual memory scenario where the pages in
physical memory didn't have images in the swap with the possible exception
of PERMANENTLY locked down memory generally used only for interrupt or system
level functions and data.
	PC 
-- 
      (O)(O)(O)(O)(O)(O)(O)(O)(O)     (O)(O)(O)(O)(O)(O)(O)(O)(O)
      (O) !the doctor is out! (O)     (0) peter@viewlogic.com (0)
      (O)(O)(O)(O)(O)(O)(O)(O)(O)     (O)(O)(O)(O)(O)(O)(O)(O)(O)