Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 27: Virtual Memory

Similar presentations


Presentation on theme: "Lecture 27: Virtual Memory"— Presentation transcript:

1 Lecture 27: Virtual Memory

2 Review: goals of memory management
Memory allocation A new process comes into memory Memory de-allocation A process leaves memory Address translation Virtual address to physical address Process isolation One process cannot access the memory of other processes

3 Review: Memory management for different systems
Processes are known in advance and can fit in memory Embedded systems, e.g., radios, washing machines, and microwaves Processes are unknown in advance, memory might not be large enough Swapping Virtual memory

4 Review: Swapping Each individual process can fit in memory
But memory cannot fit all processes Memory allocation/de-allocation Bitmap Linked list Dynamic address translation Base register in CPU Process isolation Limit register in CPU

5 Virtual memory What if a single process is larger than memory?
Not all parts of the large process are equally possible to be used Put the parts that are less used in disk The process can still run Load a part from disk to memory when needed

6 Paging: Key idea of virtual memory
Divide a program into fixed-size small parts Called virtual pages or pages Divide the memory into fixed-size small blocks Called page frames Load some pages into page frames

7 An example of paging 64K Virtual Address Space 32K Physical Memory
Divided into 16 pages 4K for each page 32K Physical Memory 8 pages of 4K each

8 Problems in paging Address translation Page fault
When a page that the process is trying to use is not in memory, hardware issues page fault Load in the page into a page frame Which page frame goes to disk? This is called page replacement problem


Download ppt "Lecture 27: Virtual Memory"

Similar presentations


Ads by Google