[comp.sys.mac.system] SE/30 VM trouble in System 7

mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) (05/29/91)

I'm running the release System 7 with no inits on a 5 Meg SE/30 with
an Apple internal 40 Meg HD. When I turn on VM with the default
settings and then reboot, "About This Macintosh" says:

Built-in Memory:   5120 K
Total Memory:    10,240 K
10,240 K used as RAM on HD

VM has claimed an extra 5 Megs, and the available disk space reported
in Finder windows also shows that an EXTRA 5 Megs have disappeared.

Anyone else see this behavior? Is this a bug, or have I made a blunder?
Thanks, Mark
-- 
Mark S. Johnson        mjohnson@stn9.me.calpoly.edu      (129.65.19.9)

gaynor@agvax2.ag.ohio-state.edu (05/29/91)

In article <2842d41f.4648@petunia.CalPoly.EDU>, mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) writes:
>
>I'm running the release System 7 with no inits on a 5 Meg SE/30 with
>an Apple internal 40 Meg HD. When I turn on VM with the default
>settings and then reboot, "About This Macintosh" says:

[stuff about how 5MB of VM eats 10MB of disk space]

Yep, that's the way it is.  2 MB of VM eats up 4 MB on my HD.  (Aiigh! 
Acronyms!).  Now, I'm not a systems programmer (my knowledge is much more in
theory than in hard code), but I'd hazard that the extra disk space
is used to keep track of usage, what's where, and to generally speed up the
addressing of VM.  I'm sure that Apple could have implemented VM in a fashion
to devour less disk space, but such an implementation would probably eat up
more physical RAM.

Of course, I could be totally off-base.  <grin>  But VM does tend to eat up
around 2 MB of disk space for each MB of VM.

---
Jim Gaynor - AgVAX System Manager - Academic Computing - Ohio State University
VMS:<gaynor@agvax2.ag.ohio-state.edu>  UNIX:<gaynor@magnus.acs.ohio-state.edu>
Disclaimer : All opinions expressed here are mine and only mine.  So there!
Witty Quote: "Think, think, think, think..." - Winnie-the-Pooh, Taoist Bear.

blob@Apple.COM (Brian Bechtel) (05/29/91)

gaynor@agvax2.ag.ohio-state.edu writes:

>In article <2842d41f.4648@petunia.CalPoly.EDU>, mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) writes:
>>
>>I'm running the release System 7 with no inits on a 5 Meg SE/30 with
>>an Apple internal 40 Meg HD. When I turn on VM with the default
>>settings and then reboot, "About This Macintosh" says:

>[stuff about how 5MB of VM eats 10MB of disk space]

>Yep, that's the way it is.  2 MB of VM eats up 4 MB on my HD.  

No.  VM uses 1 MB of hard disk for each MB of memory, with ALL memory
counting towards the total.  If you ask for 15 MB of memory, then VM
takes up 15 MB of disk space, no matter how much RAM is in your
computer.  If you specify 12 MB on an 8 MB RAM SE/30, you create a 12 MB
invisible file called "VM Storage".

--Brian Bechtel     blob@apple.com     "My opinion, not Apple's"

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

In article <2842d41f.4648@petunia.CalPoly.EDU>, mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) writes:
|> 
|> 
|> I'm running the release System 7 with no inits on a 5 Meg SE/30 with
|> an Apple internal 40 Meg HD. When I turn on VM with the default
|> settings and then reboot, "About This Macintosh" says:
|> 
|> Built-in Memory:   5120 K
|> Total Memory:    10,240 K
|> 10,240 K used as RAM on HD
|> 
|> VM has claimed an extra 5 Megs, and the available disk space reported
|> in Finder windows also shows that an EXTRA 5 Megs have disappeared.
|> 
|> Anyone else see this behavior? Is this a bug, or have I made a blunder?
|> Thanks, Mark

	Not a bug.
	Think about what virtual memory is... Essentially, your physical
memory (Built-in Memory here) acts as a high speed cache for the virtual
memory (Total Memory, which in this case resides on the hard disk). What
this means is that ALL your memory resides in the virtual memory with
copies of the most recently used addresses also living in the "cache".
	What this means is that the amount of "physical memory" has no
relation to the total amount of virtual memory. Just as the file cache
(system 4.1 and higher) didn't increase the total space on your disk,
and the PMMU cache in the 68030 doesn't increase the total physical
memory in your machine, the amount of physical memory you have doesn't
increase the total virtual memory you have allocated.
	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)

gaynor@agvax2.ag.ohio-state.edu (05/30/91)

In article <53439@apple.Apple.COM>, blob@Apple.COM (Brian Bechtel) writes:
>gaynor@agvax2.ag.ohio-state.edu writes:
>>In article <2842d41f.4648@petunia.CalPoly.EDU>, mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) writes:
>
>>[stuff about how 5MB of VM eats 10MB of disk space]
>
>>Yep, that's the way it is.  2 MB of VM eats up 4 MB on my HD.  
>
>No.  VM uses 1 MB of hard disk for each MB of memory, with ALL memory
>counting towards the total.  If you ask for 15 MB of memory, then VM
>takes up 15 MB of disk space, no matter how much RAM is in your
>computer.  If you specify 12 MB on an 8 MB RAM SE/30, you create a 12 MB
>invisible file called "VM Storage".

Well, then in an odd sense I was right.  Note, Brian, that I said 2 MB
of -VM- eats up 4 MB on my HD.  I also have 2 MB of RAM.  Thus, 4 MB
for "VM Storage".  It also makes sense for Mark - he has 5 MB RAM, 5
MB VM, so a 10 MB VM file.

I had been wondering why a 1 MB VM setting took up 3MB for the VM
storage file.  Now I at least know the equation.

Brian, could you enlighten us a bit as to why it works in this
fashion?  I mean, it seems odd to me that, according to what you've
just said, someone with 8 MB RAM who added 1 MB VM (for 9 MB total)
would have a VM Storage file of 9 MB in size.

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.

---
Jim Gaynor - AgVAX System Manager - Academic Computing - Ohio State University
VMS:<gaynor@agvax2.ag.ohio-state.edu>  UNIX:<gaynor@magnus.acs.ohio-state.edu>
Disclaimer : All opinions expressed here are mine and only mine.  So there!
Witty Quote: "Think, think, think, think..." - Winnie-the-Pooh, Taoist Bear.

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

In article <1991May29.125650.16389@zardoz.eng.ohio-state.edu>, gaynor@agvax2.ag.ohio-state.edu writes:
|> In article <2842d41f.4648@petunia.CalPoly.EDU>, mjohnson@cosmos.acs.calpoly.edu (Mark S. Johnson) writes:
|> >
|> >I'm running the release System 7 with no inits on a 5 Meg SE/30 with
|> >an Apple internal 40 Meg HD. When I turn on VM with the default
|> >settings and then reboot, "About This Macintosh" says:
|> 
|> [stuff about how 5MB of VM eats 10MB of disk space]
|> 
|> Yep, that's the way it is.  2 MB of VM eats up 4 MB on my HD.  (Aiigh! 
|> Acronyms!).  Now, I'm not a systems programmer (my knowledge is much more in
|> theory than in hard code), but I'd hazard that the extra disk space
|> is used to keep track of usage, what's where, and to generally speed up the
|> addressing of VM.  I'm sure that Apple could have implemented VM in a fashion
|> to devour less disk space, but such an implementation would probably eat up
|> more physical RAM.
|> 
|> Of course, I could be totally off-base.  <grin>  But VM does tend to eat up
|> around 2 MB of disk space for each MB of VM.
|> 
	Sorry, but the disk space IS your virtual memory. If you have a 1MB
Mac and you allocate 10MB of virtual memory you eat up 10MB of disk space.
Of course, you also won't get anything done because you'll spend your life
paging memory in and out from disk but hey...
	The rule of thumb for allocating swap space (virtual memory to you
mac hacks) is 2MB of virtual to 1MB of physical. Anything more than that
and you start beating the disk to death.
	Just remember, if you are using virtual memory, the memory actually
sitting in your mac is purely a subway stop for the memory on your disk. It
doesn't add anything extra to what you assign.
	Oh, and by the way, if your mac has 8 1MB simms in it and you allocate
4MB virtual memory (assuming you could even do something so foolish), you lose
4MB. Not only that but you'll have just wasted 4MB of disk space since you'll
never page.
	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)