10_virtualmemory

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

Info iconThis preview shows pages 1–10. 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Memory Management Overview q 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 q Mechanisms Ø Physical and virtual addressing Ø Techniques: partitioning, paging, segmentation Ø Page table management, TLBs, VM tricks q Policies Ø Page replacement algorithms
Background image of page 2
Virtual Memory Introduction q VM allows running processes that have memory requirements larger than available RAM to run in the computer. q The following processes are running with the noted requirements: Ø Firefox (800MB), Ø MSWord (200MB), Ø Yahoo Messenger (30MB) Ø Operating System (400MB). q This would require 1430MB of memory when there may only be 1024MB of RAM available
Background image of page 3

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

View Full DocumentRight Arrow Icon
Virtual Memory q 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 l needs z Ø Can also run on a machine with l too much z 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 q Let ` s go back to the beginning…
Background image of page 4
In the beginning… q Rewind to the days of l second-generation z computers Ø Programs use physical addresses directly Ø OS loads job, runs it, unloads it q Multiprogramming changes all of this Ø Want multiple processes in memory at once v Overlap I/O and CPU of multiple jobs Ø Can do it a number of ways v Fixed and variable partitioning, paging, segmentation Ø Requirements v Need protection – restrict which addresses jobs can use v Fast translation – lookups need to be fast v Fast change – updating memory hardware on context switch
Background image of page 5

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

View Full DocumentRight Arrow Icon
Virtual Addresses q 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
Background image of page 6
Virtual Addresses q Many ways to do this translation… Ø Paging is an efficient way of accomplishing this vmap processor physical memory virtual addresses physical addresses
Background image of page 7

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

View Full DocumentRight 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 Address
Background image of page 8
Fixed Partitions q Physical memory is broken up into fixed partitions
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/06/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Spring '11 term at Purdue.

Page1 / 37

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

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online