[comp.sys.mac.system] Virtual Memory and Disk Usage

ashwin@gatech.edu (Ashwin Ram) (05/29/91)

1. When I turn on virtual memory on my IIsi, my disk usage (as indicated by
   the disk size at the top of a folder window) goes up by an amount equal to
   the total virtual memory.  For example, if I want 4Mb of memory in
   addition to the 5Mb of RAM that I have, the system takes 9Mb out of my
   disk space.

   Is this normal?  I can see that the straightforward way of implementing
   virtual memory would be to allocate 9Mb of disk space, and treat the RAM
   as a 5Mb cache so that 5Mb of the 9Mb would be paged into main memory at
   any given time.  However, an alternate (and not much more complex) scheme
   would need only 4Mb plus one page (1k or whatever the page size is) on
   disk.  When needed, the system would swap a page out and then read the
   requested page in.  (This scheme requires less disk but may involve extra
   disk writes if >5Mb is in use and a clean page needs to be swapped out.)

   Does anyone know how it's done in system 7?  (Just want to be sure I
   haven't lost disk space in the upgrade.)

2. The sum of the sizes of the files and folders in the top level hard disk
   folder (as shown in the Name view) is less than the amount that the system
   thinks I've used (as shown by the numbers at the top of the folder
   window).  The difference is considerable (almost 2Mb).  Is this being
   taken up by invisible files (e.g., the Desktop file), or do I need to
   garbage collect my disk (if so, how?)?

Thanks,

-- Ashwin.

ml27192@uxa.cso.uiuc.edu (Mark Lanett) (05/29/91)

ashwin@gatech.edu (Ashwin Ram) writes:

>1. When I turn on virtual memory on my IIsi, my disk usage (as indicated by
[...]
>   Is this normal?  I can see that the straightforward way of implementing
>   virtual memory would be to allocate 9Mb of disk space, and treat the RAM
>   as a 5Mb cache so that 5Mb of the 9Mb would be paged into main memory at
>   any given time.  However, an alternate (and not much more complex) scheme
>   would need only 4Mb plus one page (1k or whatever the page size is) on
>   disk.  When needed, the system would swap a page out and then read the
>   requested page in.  (This scheme requires less disk but may involve extra
>   disk writes if >5Mb is in use and a clean page needs to be swapped out.)

You are correct in your thinking. However, your "not much more complex" 
method is used by nobody since it requires almost twice as many writes. Apple
is doing it just like everybody else this time.

>-- Ashwin.
--
//-----------------------------------------------------------------------------
Mark Lanett						ml27192@uxa.cs.uiuc.edu
Software Tools Group, NCSA				mlanett@ncsa.uiuc.edu
I'm not an idiot; I just play one on the net.