SLIDE 11 Terms
Virtual memory
– Storage allocation scheme
Secondary memory can be addressed as though it were part of main memory. Size of virtual storage limited by:
– the architecture addressing scheme – the amount of secondary memory available – not by the actual size of main memory Virtual address
– address assigned to a location in virtual memory
that location is accessed as it were part of main memory
Virtual address space
– Virtual storage assigned to a process.
Address space
– Range of memory addresses available to a process.
Real address
– Address of a location in main memory
Keys
All memory references within a process are logical addresses
– dynamically translated into physical addresses at run time (mapping can change)
a process may be swapped in and out of main memory
– it occupies different regions of main memory at different times
A process may be broken up into a number of pieces
– contiguous allocation is not needed
All of the portions of a process in main memory during execution:
not necessary
– portions can stay in secondary memory and be fetched when needed – portions in main memory can be moved in secondary memory when space is needed
Virtual memory
Main memory Secondary memory
Process A portions Process B portions
paging and/or segmentation
swapping
Locality and virtual memory
Programs tend to use only a small subset of addresses in
a time interval
– not all process image portions are needed at the same time – current used portions: working set
Pages in main memory Page fault rate
W: working set size
Page fault: access to a page not in main memory Time W
transients stable stable stable stable
Working set evolution
On demanding paging
Load a page in main memory only when needed
– CPU try to access a page not in main memory: page fault
valid bit in page table signals if a page is in main memory (page valid)
– Fast process start – Reduced memory usage
allows higher multiprogramming degree
Effective access time: EAT = 1pt mempt faultt mem
p: page fault probability tmem: access time for a frame (typ.: 10ns) access to TLB access to page table access to memory tfault: time for handling page fault (typ.: 1ms)