1What is virtual memory?
Virtual memory is the separation of user logical memory from physical memory.
2What is the benefit of virtual memory for processes?
It allows a large virtual memory to be provided to processes even if the physical memory is small.
3How does virtual memory help programmers?
It offloads programmers from having to worry about writing overlay codes.
4How is virtual memory implemented?
Virtual memory is implemented using demand paging or demand segmentation.
5What responsibility do demand paging and demand segmentation take off the programmer?
They take the responsibility off the programmer for coding overlays, fixed, or variable partitions.
6Where does a process reside before execution in demand paging?
A process resides in secondary storage (usually a disk).
7How are processes brought into memory in demand paging?
When a process needs to be executed, it is paged into memory.
8Are entire processes loaded into memory in demand paging?
No, only the pages that are needed are brought in by a lazy swapper.
9What hardware support is needed for demand paging?
Hardware support is needed to distinguish between pages that are in memory and those on disk.
10What is the valid-invalid scheme in demand paging?
Valid means the page is in memory and legal; invalid means the page is either not in the logical address space or is on the disk.
11What are the advantages of demand paging?
Avoids reading pages that will not be used, decreases paging time, and decreases the need for physical memory.
12What is the role of a pager?
A pager decides which pages to bring into memory.
13How does a pager differ from a swapper?
A pager is concerned with individual pages of a process, while a swapper manipulates the entire process.
14How does a pager predict which pages to bring in?
The pager guesses which page will be used before the process is swapped out again.
15How is memory divided in demand segmentation?
Address spaces are divided into segments.
16What is a segment in demand segmentation?
Each segment has a linear sequence of addresses from 0 to a maximum value.
17Can segment lengths change during execution?
Yes, segment lengths may change during execution.
18How does demand segmentation support flexible memory use?
Each segment has different addresses and can shrink and grow without affecting other segments.
19How are segments tracked in demand segmentation?
Segment tables are used to keep track of segments.
20What does demand segmentation allocate memory into?
Demand segmentation allocates memory into segments.
21What is the difference between demand paging and demand segmentation?
Demand paging focuses on fixed-size blocks (pages), while demand segmentation uses variable-sized logical units (segments).
22What do both demand paging and demand segmentation implement?
Both are techniques for implementing virtual memory.