Chapter 10 - Virtual Memory Flashcards
What does virtual memory do?
Virtual memory abstracts physical memory into an extremely large uniform array of storage.
What are the benefits of virtual memory?
The benefits of virtual memory include the following:
1. a program can be larger than physical memory
2. a program does not need to be entirely in memory
3. processes can share memory
4. processes can be created more efficiently
What is demand paging?
Demand paging is a technique whereby pages are loaded only when they are demanded during program execution. Pages that are never demanded are thus never loaded into moemry.
When does a page fault occur?
A page fault occurs when a page that is currently not in memory is accessed. The page must be brought from the backing store into an available page frame in memory.
What does copy-on-write allow?
Copy-on-write allows a child process to share the same address space as its parent. If either the child or the parent process writes (modifies) a page, a copy of the page is made.
What happens when available memory runes low?
When available memory runs low, a paage-replacement algorithm selects an existing page in memory to replace with a new page. Page-replacement algorithms include FIFO, optimal, and LRU. Pure LRU algorithms are impractical to implement, and most systems instead use LRU-approximation algorithms.
What do global page-replacement algorithms do?
Global page-replacement algorithms select a page from any process in the system for replacement, while local page-replacement algorithms select a page from the faulting process.
When does thrashing occur?
Thrashing occurs when a system spends more time paging than executing.
What does a locality represent?
A locality represents a set of pages that are actively used together. As a process executes, it moves from locality to locality. A working set is based on locality and is defined as the set of pages currently in use by a process.
What is memory compression?
Memory compression is a memory-management technique that compresses a number of pages into a single page. Compressed memory is an alternative to paging and is used on mobile systems that do not support paging.
How is kernel memory allocated?
Kernel memory is allocated differently than user-mode processes; it is allocated in contiguous chunks of varying sizes. Two common techniques for allocating kernel memory are
1. the buddy system
2. slab allocation
What does TLB reach refer to?
TLB reach refers to the amount of memory accessible from the TLB and is equal to the number of entries in the TLB multiplied by the page size. One technique for increasing TLB reach is to increase the size of pages.
How do Linux, Windows, and Solaris manage virtual memory?
Linux, Windows, and Solaris manage virtual memory similarly, using demand paging and copy-on-write, among other features. Each system also uses a variation of LRU approximation known as the clock algorithm.