SlideServe
Menu
Préférences
© SlideServe · v2026

Virtual Memory

crystal-gemini avatar
16 diapositives · 406 Views · Nov 19, 2014

Virtual Memory. Why do we need VM? . Program address space: 0 – 2^32 bytes 4GB of space Physical memory available 256MB or so Multiprogramming systems Have more than one program running. What do we do?. Paging Break up the memory space into equal-sized blocks - pages

Virtual Memory - slide 1
01 / 16Virtual Memory
1 / 17

Télécharger la présentation

Virtual Memory
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Virtual Memory

  2. Why do we need VM? • Program address space: 0 – 2^32 bytes • 4GB of space • Physical memory available • 256MB or so • Multiprogramming systems • Have more than one program running

  3. What do we do? • Paging • Break up the memory space into equal-sized blocks - pages • Put the program into main memory a page at a time • Avoids fragmentation • What kind? • What about fragmentation within a page?

  4. Address Translation • Virtual Addr  Physical Addr • If the page is in Physical Memory • Otherwise the page is on Disk • Page Fault!

  5. How does the translation work? • Going from a 4GB address space to a 512MB address space • Virtual Address bit size? • Physical Address bit size? • What’s the page size? • 4K, 8K, 16K … • Page offset bit size?

  6. How does the translation work? II • Page Number = Address / Page Size • Page Number = higher n-k bits • k = number of bits for the page offset

  7. The big picture

  8. Page Faults • What if the page is not in Physical Memory • How do we know? • What do we need to do? • Bring the page into PM • What if PM is full? • How do we choose a victim? • What happens to the victim?

  9. Write Policies • Two options: • Write-through • Write-back What are the costs? • How do we know when to write? • Do we always write? • How does this compare to cache?

  10. Caching the Page Table • What does it take to access memory? • getting the instruction • what if it’s a load or a store? • Translation-lookaside Buffer (TLB) • Small number of entries • Keeps recently accesses VM  PM translations Small hit time Small miss rate

  11. VM and the Cache • Address translations happen first and the cache is oblivious of Virtual Memory

  12. Other Stuff • Protection with VM • Protection bits are part of the page table • Used to isolate user program data • Can be used for shared memory

  13. Page Tables • Example 1 • Given 16K pages • How big is the page table? • How do we do address translations?

  14. Handling page faults • Example 2 • TLB: hit = 95%, 2 cycles • Page Table: hit = 99.999%, 100 cycles • Disk Access: 1,000,000 cycles What’s the average number of cycles per memory access?

  15. Translations • Example 3 • Bits 0 though 9 represent the page offset • What's the physical address corresponding to the virtual address 2073?