Download - NOV11 Virtual Memory
-
8/10/2019 NOV11 Virtual Memory
1/15
Virtual Memory
Deung young, MoonELEC 5200/6200 Computer Architecture and Design
Lectured by Dr. V. [email protected]
-
8/10/2019 NOV11 Virtual Memory
2/15
Memory
register
CPU cache
Main Memory
Secondary Storage
Server (or INTERNET)
larger capacity lower speed lower cost
-
8/10/2019 NOV11 Virtual Memory
3/15
What is
Virtual memory as an alternate set ofmemory addresses.Programs use these virtual addressesrather than real addresses to storeinstructions and data.When the program is actually executed,the virtual addresses are converted intoreal memory addresses.
-
8/10/2019 NOV11 Virtual Memory
4/15
History
virtual memory was developed inapproximately 1959 1962, at the Universityof Manchester for the Atlas Computer,
completed in 1962.
In 1961, Burroughs released the B5000, thefirst commercial computer with virtual memory.
-
8/10/2019 NOV11 Virtual Memory
5/15
Why is it needed .
Before the development of the virtual memorytechnique, programmers in the 1940s and1950s had to manage directly two-levelstorage such as main memory or ram and
secondary memory in the form of hard disksor earlier, magnetic drums.
Enlarge the address space, the set of
addresses a program can utilize.Virtual memory might contain twice as manyaddresses as main memory.
-
8/10/2019 NOV11 Virtual Memory
6/15
-
8/10/2019 NOV11 Virtual Memory
7/15
How does it work
To facilitate copying virtual memory into realmemory, the operating system divides virtualmemory into pages, each of which contains afixed number of addresses.Each page is stored on a disk until it isneeded.When the page is needed, the operating
system copies it from disk to main memory,translating the virtual addresses into realaddresses.
-
8/10/2019 NOV11 Virtual Memory
8/15
MMU Memory Management Unit)
The hardware base that makes a virtual memorysystem possible.Allows software to reference physical memory byvirtual addresses, quite often more than one.
It accomplishes this through the use of page andpage tables.Use a section of memory to translate virtualaddresses into physical addresses via a series oftable lookups.The software that handles the page fault is generallypart of an operating system and the hardware thatdetects this situation.
-
8/10/2019 NOV11 Virtual Memory
9/15
Segmentation Segmentation involves the relocation of variable sizedsegments into the physical address space.Generally these segments are contiguous units, andare referred to in programs by their segment numberand an offset to the requested data.Efficient segmentation relies on programs that arevery thoughtfully written for their target system.Since segmentation relies on memory that is locatedin single large blocks, it is very possible that enoughfree space is available to load a new module, but cannot be utilized.Segmentation may also suffer from internalfragmentation if segments are not variable-sized,where memory above the segment is not used by theprogram but is still reserved for it.
-
8/10/2019 NOV11 Virtual Memory
10/15
-
8/10/2019 NOV11 Virtual Memory
11/15
Paging cont d)
A technique used by virtual memory operatingsystems to help ensure that the data youneed is available as quickly as possible.
The operating system copies a certainnumber of pages from your storage device tomain memory.When a program needs a page that is not in
maim memory, the operating system copiesthe required page into memory and copiesanother page back to the disk.
-
8/10/2019 NOV11 Virtual Memory
12/15
Virtual Memory Paging)
Page table
Address Space
Page table
Address Space
Physical
Memory
-
8/10/2019 NOV11 Virtual Memory
13/15
Page faultAn interrupt to the software raised by thehardware when a program accesses a pagethat is not mapped in physical memory.
when a program accesses a memory locationin its memory and the page corresponding tothat memory is not loadedwhen a program accesses a memory location
in its memory and the program does not haveprivileges to access the page correspondingto that memory.
-
8/10/2019 NOV11 Virtual Memory
14/15
-
8/10/2019 NOV11 Virtual Memory
15/15
Summary Virtual memory is a common part of most operatingsystems on computers.It has become so common because it provides a bigbenefit for users at a very low cost.benefits of executing a program that is only partiallyin memory.program is no longer constrained by the amount ofphysical memory.
user would be able to write programs for anextremely large virtual address space.more programs could be run at the same time
increase CPU utilization and throughput.less I/O would be needed to load or swap each userprogram
run faster