DOC PREVIEW
SJSU CS 147 - Virtual Memory

This preview shows page 1-2-21-22 out of 22 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 22 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Virtual MemoryWhat is Virtual MemorySlide 3Why use Virtual memory?Back ThenThe HistoryThe History (cont.)TermsImplementationPagingA Page TablePaging (cont.)Paging: How it worksPaging ExampleSlide 15Paging Example (cont.)Slide 17Slide 18Slide 19Slide 20SegmentationQuestionsVirtual MemoryAbbas RizviCS 147Sin Min LeeWhat is Virtual Memory•Computer system technique that gives the impression of continuous working memory to applications.•Uses the hard disk as an extension of the RAM. •This increases available address space a process can use.•The memory is actually physically fragmented. •Excess memory is stored in area of hard disk called page file.Why use Virtual memory?•Computers don’t have enough memory to handle multiple applications running at the same time.•Using virtual memory gives the computer more main memory than it actually has. •Its all invisible to the user.Back Then•Overlays were used for applications that were too large. •Overlays are self-contained code blocks of memory that the programmer had to manage manually. •Size of overlays are different for different systems. •Still around in cheap hardware.The History•First developed in University of Manchester in 1962. •The B5000 was the first computer to implement Virtual Memory. •Virtual memory required many different theories, models, and experiments before it was adopted.The History (cont.)•Virtual memory was initially controversial.•Required expensive, specialized, difficult to build hardware. •In 1969, IBM research team showed that virtual memory was more consistent than manually controlled systems.Terms•Virtual Address: Logical or program address that the process uses. •Physical Address: Real address in physical memory. •Mapping: Mechanism by which virtual addresses are translated into physical ones. •Page Frames: equal size blocks into which main memory is divided. •Pages: blocks into which virtual memory is divided which is equal to the size of the page frame. •Paging: process of copying a virtual page from disk to a page frame in main memory. •Fragmentation: memory that becomes unusable. •Page Fault: an event that occurs when a requested page is not in main memory and must be copied into memory from disk.Implementation•Virtual Memory is implemented through paging, segmentation or a combination of the two. •Paging is the most popular.Paging•Paging is dependent on the locality principle. •When data is needed that does not reside in main memory , the entire block in which the data resides is copied from the disk to main memory. •Physical memory is allocated to processes in fixed blocks. •Address space is divided equally into pages.A Page Table•Pages are stored in a page table.•Page tables store the physical locations of each virtual page. •Page table sets valid bit to 0 if the page is not in the main memory. Sets to 1 if page is in main memory.Paging (cont.)•Every process has its own page table.•Could add more information to page table like modify bit or usage bit, but its not necessary.Paging: How it works•Once the virtual address is generated, the system dynamically translates the virtual address to physical address. •To accomplish this, the virtual address is divided into two parts: a page field and an offset field. •This represents the offset within that page where the requested data is located.Paging Example•Given:1. virtual address space: 28 words for a given process. 2. Physical memory has 4 pages per frame. 3. A page has 32 words in length4. Page TableVirtual MemoryPhysical Memory032170654321Paging Example (cont.)•Virtual address contains 8 bits. •Physical address contains 7 bits(4 pages/frame * 32 words/page = 128 words {27 } )|----Page-----| |-----------Offset-----------||-------------------Virtual Address-----------------|Paging Example (cont.)•Page field has 3 bits. (28 / 25 = 23 )•Offset field has 5 bits. (32 = 25 )•Now, lets say system generates virtual address of 13. •Convert to Binary:1310 = 000011012Paging Example (cont.)•Divide virtual address in two. 000011012•Page field = 000•Offset field = 01101•Use page field as index into the page table.0 0 0 0 1 1 0 1Virtual Address:Paging Example (cont.)•000 is 0th entry in page (page 0) and maps to frame 2. •Thus, physical memory is page frame 2, with offset 13. •So, convert 2 to binary210 = 102Paging Example (cont.)•So the physical address is:•10011012 = 77101 0 0 1 1 0 1Segmentation•Address space is divided into segments. •The operating system looks for large amount of free memory to store the segments when the segments needs to be copied into physical memory. •Segments are stored in segments tables indicating their


View Full Document

SJSU CS 147 - Virtual Memory

Documents in this Course
Cache

Cache

24 pages

Memory

Memory

54 pages

Memory

Memory

70 pages

Lecture 1

Lecture 1

53 pages

Cisc

Cisc

18 pages

Quiz 1

Quiz 1

4 pages

LECTURE 2

LECTURE 2

66 pages

RISC

RISC

40 pages

LECTURE 2

LECTURE 2

66 pages

Lecture 2

Lecture 2

67 pages

Lecture1

Lecture1

53 pages

Chapter 5

Chapter 5

14 pages

Memory

Memory

27 pages

Counters

Counters

62 pages

Load more
Download Virtual Memory
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Virtual Memory and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Virtual Memory 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?