Discussion:
[Simh] Virtual memory
Larry Baker
2018-02-18 17:20:40 UTC
Permalink
Date: Sun, 18 Feb 2018 11:08:24 +0100
Subject: Re: [Simh] Simh Digest, Vol 169, Issue 58
Content-Type: text/plain; charset=utf-8; format=flowed
Johnny,
Memory mapped overlays potentially wasted lots of space. The "problem"
is that each overlay level must be page aligned, which means 8K aligned.
It also means that you cannot have more than 7 levels, since you only
have 8 pages. Compare to disk based overlays, which can pack the levels
right next to each other, and it should be obvious that you potentially
loose a lot of memory with memory mapped overlays.
I was confused why you think memory is wasted. It actually is not. It is true that the program address space can only be mapped by an entire window. Thus, you have to be clever about packing the 8K address window. However, there is no requirement that an entire address window be mapped. The real memory allocated is only the portion that is mapped. The system memory is packed tightly, just the same for regular contiguous (on RSX at least) allocations for any program. Real memory is not wasted.

Larry Baker
US Geological Survey
650-329-5608
***@usgs.gov
Johnny Billquist
2018-02-18 23:39:01 UTC
Permalink
Hi, Larry.
Post by Larry Baker
Date: Sun, 18 Feb 2018 11:08:24 +0100
Subject: Re: [Simh] Simh Digest, Vol 169, Issue 58
Content-Type: text/plain; charset=utf-8; format=flowed
Johnny,
Memory mapped overlays potentially wasted lots of space. The "problem"
is that each overlay level must be page aligned, which means 8K aligned.
It also means that you cannot have more than 7 levels, since you only
have 8 pages. Compare to disk based overlays, which can pack the levels
right next to each other, and it should be obvious that you potentially
loose a lot of memory with memory mapped overlays.
I was confused why you think memory is wasted.  It actually is not.  It
is true that the program address space can only be mapped by an entire
window.  Thus, you have to be clever about packing the 8K address
window.  However, there is no requirement that an entire address window
be mapped.  The real memory allocated is only the portion that is
mapped.  The system memory is packed tightly, just the same for regular
contiguous (on RSX at least) allocations for any program.  Real memory
is not wasted.
Oh! We're talking past each other. You are absolutely right. It does not
waste physical memory space. It potentially wastes virtual memory
address space. That is what I was referring to. If you want to get a lot
of code in, which usually is the case if you're dealing with overlays in
the first place, then memory resident overlays can make it complicated
to really get more memory out of the thing with memory mapped overlays.
It can be done, and it certainly is way faster, but there are potential
headaches in there.

All good, I hope. :-)

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Larry Baker
2018-02-18 23:45:32 UTC
Permalink
Post by Johnny Billquist
All good, I hope. :-)
Yup!

Larry Baker
US Geological Survey
650-329-5608
***@usgs.gov

Loading...