virtual memory
Concept
- secondary storage is usually larger than memory
- extension of the paging scheme, some pages can be stores on the secondary storage
- OS required to manage the virtual memory
- like a second layer of caching
Page fault
- pages can only be accessed when in memory, CPU cannot read data from secondary storage
- when CPU tries to access a non-memory resident page
- triggers the OS to bring the page into physical memory
Thrasing
- if memory access results in page faults most of the time
- accessing secondary storage is very slow, so this can slow down the system
- larger page size -> exploit spatial locality
Demand paging
- process starts with no memory resident pages
- pages are only allocated when there is a page fault
- pros:
- fast startup time
- small memory footprint
- cons:
- process may be sluggish at the start
- page faults may have cascading effect on other processes, thrashing