Lecture 17: Virtual Memory 1 Flashcards
Assumption for Virtual Memory
degree of multiprogramming bounded by amount of disk space
for set of active processes: S(logical address spaces) <= size of disk
Virtual Memory
Means:
1. High memory utilization, flexible memory allocation: allow allocated memory to be noncontiguous (chunked), out-of-order
- Swapping and virtual memory: allow some processes to have address space dynamically mapped to physical memory
Swapping
Idea:
•ready or blocked processes have no physical memory allocation. Instead, address space mapped to disk
Swapping (+,-)
Achieves Higher Degree of Multiprogramming Swapping • not limited by available memory, but by available disk• modify context-switch routine to add swap-out and swap-in1.
Expensive: May need a lot of disk I/O2. Time-variable: Depends on process size
Virtual Memory
Ready, blocked or running process have some (but not all)of their allotment of physical memory
Demand Paging
Idea:
Demand: Bring a page into memory only when it’s needed
Paging: Units of allocation are pages (fixed size)
® less I/O needed
® less memory needed
® more users allowable
Implementation:
Straightforward extension of paging
Page Replacement:
• find some page in memory but not really in use, and swap it out
Page Fault Rate:
- p = 0 → no page faults
* p = 1 → every reference is a fault
Effective Access Time
EAT = (1 - p) ´ memory access time p x ( page fault overhead \+ [swap page out] \+ swap page in \+ restart overhead )
Some Typical Numbers
Memory Access Time: 1 microsecond
• swap page in time = swap page out time = 10,000 microseconds
• 50% of time, page being replaced has been modified (dirty) and needs to
be swapped out
When is a page needed?
when it is referenced (read or written).