1 / 15

Virtual Memory

Virtual Memory. -Neha Jain. Topics Covered. Introduction Virtual Memory Address Translation Thrashing and Protection References. Introduction. Memory Hierarchy. CPU. Memory Content : Cache  Main Mem  Secondary Mem. Functional units.

braeden
Download Presentation

Virtual Memory

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Virtual Memory -Neha Jain ELEC6200-001

  2. Topics Covered • Introduction • Virtual Memory • Address Translation • Thrashing and Protection • References ELEC6200-001

  3. Introduction • Memory Hierarchy CPU Memory Content: Cache  Main Mem Secondary Mem Functional units Registers Memory Parameters: Access Time: increase with distance from CPU Cost/Bit: decrease with distance from CPU Capacity: increase with distance from CPU Internal cache External Cache Main Memory Cache : use SRAM (faster and costly) Main Memory : use DRAM (slower and cheap) Secondary Memory (Disk) ELEC6200-001

  4. Principle of Locality • Temporal Locality : Item tend to be referenced again soon • Spatial Locality : Nearby items tend to be referenced again soon • Cache Memory -Takes advantage of principle of locality ELEC6200-001

  5. Virtual Memory • A technique that uses main memory as a “cache” for secondary storage • Basic Terminology • Page : Fixed number of bytes recognized by operating system • Page Fault : Occurs when accessed page is not in main memory • Physical Address : Address in main memory • Virtual Address: Addresses that application programmers deal with and are translated by MMU to physical address ELEC6200-001

  6. 31 30 29 28 27 ……………....13 12 11………….…….…2 1 0 Virtual Page Number Page Offset Translation 29 28 27 ……………………...13 12 11………….…….…2 1 0 Physical page number Page Offset MMU: Memory management unit Physical address Virtual Address Cache Data Processor Physical address Data Main memory Virtual Address ELEC6200-001 Physical Address

  7. Physical Memory Memory Management Unit (MMU) S1 x S3 free S2 S3 x S1 Segment Table free S4 Segmented Memory ELEC6200-001

  8. Virtual Address Physical Memory Segment # Displacement Segment Table + V prot limit base datum Protection Physical address Compare segment Limit to displacement Mapping Segmented Address Segment# : specifies which segment to use( base address and length) Displacement: offset from base address for actual memory access ELEC6200-001

  9. P a g e t a b l e P h y s i c a l m e m o r y P h y s i c a l p a g e o r d i s k a d d r e s s Page table for address translation V i r t u a l p a g e n u m b e r V a l i d 1 1 1 1 0 1 1 0 D i s k s t o r a g e 1 1 0 1 ELEC6200-001

  10. Page Tables The page table ,PC and registers specifies the state or process of a program Swap Space : Space on hard disk for all the pages of a process ELEC6200-001

  11. Making Address Translation Fast • By Translation-lookaside Buffer ELEC6200-001

  12. TLBs and Caches ELEC6200-001

  13. Who handles page faults? • Operating System (in system software) - Look up page table - Choose a physical page to replace - Bring referenced page from disk into chosen physical page ELEC6200-001

  14. Thrashing is a disaster and it occurs when program does not follow locality principle and continuously swaps pages from main memory to disk • Protection • One of the way is by having different physical addresses for a same virtual address ELEC6200-001

  15. References • http://www.eng.auburn.edu/users/nelsovp/courses/elec5200_6200/ • http://www.eng.auburn.edu/users/agrawvd/E5200/course.html • http://webster.cs.ucr.edu/AoA/Windows/HTML/MemoryArchitecturea3.html ELEC6200-001

More Related