{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

10_virtualmemory

10_virtualmemory - Part 10 Virtual Memory CS252 Systems...

Info icon This preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Part 10: Virtual Memory CS252: Systems Programming Ramana Kompella Computer Science Department Purdue University
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Memory Management Overview Goals of memory management Øඏ To provide a convenient abstraction for programming Øඏ To allocate scarce memory resources among competing processes to maximize performance with minimal overhead Mechanisms Øඏ Physical and virtual addressing Øඏ Techniques: partitioning, paging, segmentation Øඏ Page table management, TLBs, VM tricks Policies Øඏ Page replacement algorithms
Image of page 2
Virtual Memory Introduction VM allows running processes that have memory requirements larger than available RAM to run in the computer. The following processes are running with the noted requirements: Øඏ Firefox (800MB), Øඏ MSWord (200MB), Øඏ Yahoo Messenger (30MB) Øඏ Operating System (400MB). This would require 1430MB of memory when there may only be 1024MB of RAM available
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Virtual Memory Virtual memory enables a program to execute with less than its complete data in physical memory Øඏ A program can run on a machine with less memory than it needs Øඏ Can also run on a machine with too much physical memory Øඏ Many programs do not need all of their code and data at once (or ever) – no need to allocate memory for it Øඏ OS will adjust amount of memory allocated to a process based upon its behavior Øඏ VM requires hardware support and OS management algorithms to pull it off Let s go back to the beginning…
Image of page 4
In the beginning… Rewind to the days of second-generation computers Øඏ Programs use physical addresses directly Øඏ OS loads job, runs it, unloads it Multiprogramming changes all of this Øඏ Want multiple processes in memory at once Overlap I/O and CPU of multiple jobs Øඏ Can do it a number of ways Fixed and variable partitioning, paging, segmentation Øඏ Requirements Need protection – restrict which addresses jobs can use Fast translation – lookups need to be fast Fast change – updating memory hardware on context switch
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Virtual Addresses To make it easier to manage the memory of processes running in the system, we re going to make them use virtual addresses (logical addresses) Øඏ Virtual addresses are independent of the actual physical location of the data referenced Øඏ OS determines location of data in physical memory Øඏ Instructions executed by the CPU issue virtual addresses Øඏ Virtual addresses are translated by hardware into physical addresses (with help from OS) Øඏ The set of virtual addresses that can be used by a process comprises its virtual address space
Image of page 6
Virtual Addresses Many ways to do this translation… Øඏ Paging is an efficient way of accomplishing this vmap processor physical memory virtual addresses physical addresses
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Translating Virtual to Physical Addresses CPU Memory Cache Memory Management Unit (MMU) Translation Look- Aside Buffer (TLB) Page Table Register Page Table RAM I/O Address Bus Data Bus Virtual Address Physical
Image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern