Virtual Memory Management Practice Quiz (18 questions)

All questions and answers

1. A process uses a 32-bit virtual address space, 4 KB pages, and 4-byte page-table entries. How large is its single-level page table?

4 MB
1 MB
16 MB
4 GB

4 MB

Explanation

The address space contains 232/212=2202^{32}/2^{12}=2^{20} pages, so the table has 2202^{20} entries; at 4 bytes each, it occupies 2222^{22} bytes, or 4 MB. The 1 MB choice uses too few bytes per entry, 16 MB overcounts the entries, and 4 GB confuses the virtual address-space size with the page-table size.

2. A system designer wants to reduce the memory required for page tables. Which set names methods that can do this?

Segmentation, swapping, and memory-mapped files
Hierarchical, hashed, and inverted page tables
Direct-mapped, set-associative, and fully associative caches
Larger pages, cache lines, and TLB entries

Hierarchical, hashed, and inverted page tables

Explanation

Hierarchical, hashed, and inverted page tables are approaches used to reduce page-table size. The other choices concern page sizing, translation hardware, or memory and cache mechanisms rather than the listed page-table reduction methods.

3. A memory system breaks a virtual address space into multiple page tables, thereby paging the page table itself. What is this organization called?

Hashed paging
Inverted paging
Hierarchical paging
Segmented addressing

Hierarchical paging

Explanation

Hierarchical paging divides the virtual address space into multiple page tables, effectively paging the page table itself. Hashed paging uses hashing, inverted paging organizes entries around physical frames, and segmented addressing divides an address space into segments.

4. A system uses a two-level page table with 32-bit virtual addresses and 4 KB pages. Which bit fields should it use for the outer index, inner index, and page offset, respectively?

12 bits, 8 bits, and 12 bits
10 bits, 12 bits, and 10 bits
20 bits, 0 bits, and 12 bits
10 bits, 10 bits, and 12 bits

10 bits, 10 bits, and 12 bits

Explanation

A 4 KB page requires a 12-bit offset, leaving 20 address bits for the two indexes; the two-level format divides those evenly into 10-bit outer and inner indexes. The alternatives misallocate the index bits or collapse the two levels into one.

5. A system hashes each virtual page number to a table location, where several entries may share that hash value. What structure should the table location lead to?

A list containing only page-frame values
A linked list of entries sharing that hash value
A separate page table for each process
A single entry indexed directly by the virtual page number

A linked list of entries sharing that hash value

Explanation

A hashed page table uses the hash value to locate a linked list of entries that share that value. Direct indexing skips hashing, separate tables characterize a different organization, and frame-only lists omit the entries.

6. Which design describes an inverted page table in a system running multiple processes?

One system-wide page table with one entry per real memory page
One system-wide page table with one entry per virtual page
One page table per process with one entry per virtual page
One linked list per hash value with one entry per process

One system-wide page table with one entry per real memory page

Explanation

An inverted page table has one entry for each real memory page and one table shared by all processes. A per-process table or virtual-page-based entry count describes a different organization; hash-collision lists belong to hashed page tables.

7. A program has several pages, but only two are needed at the start of execution. Under demand paging, when should the remaining pages be loaded into physical memory?

Before the program begins execution
At regular intervals during execution
When execution needs each page
Whenever the operating system examines a page-table entry

When execution needs each page

Explanation

Demand paging brings a page into physical memory when it is needed during execution. Loading all pages in advance ignores demand, while fixed intervals or page-table examination are not the demand-based trigger.

8. A process references a page whose valid-invalid bit is marked invalid because the page is not resident in main memory. What occurs as a result of that reference?

A page fault is raised
The page is treated as resident
The reference is necessarily classified as invalid
The page is loaded without a fault

A page fault is raised

Explanation

An invalid bit indicates that the page is not in main memory, so referencing it causes a page fault. A resident page is marked valid; an invalid program reference is a separate issue assessed when handling the fault.

9. A process references a valid page that is not in memory, causing a page fault. Which sequence correctly describes the operating system’s response?

Validate the reference, allocate a frame, load the page, update the table, mark it valid, and restart the instruction
Validate the reference, restart the instruction, allocate a frame, mark it valid, and load the page
Validate the reference, allocate a frame, mark it valid, restart the instruction, and then load the page
Allocate a frame, load the page, validate the reference, restart the instruction, and update the table

Validate the reference, allocate a frame, load the page, update the table, mark it valid, and restart the instruction

Explanation

For a valid reference, the operating system allocates a frame, loads the page from disk, updates the page table, marks the page valid, and restarts the instruction. The other sequences move validation or restart ahead of required loading and page-table updates.

10. A process repeatedly swaps pages in and out and makes little progress because it has too few frames. What condition is it experiencing?

A page fault
Segmentation
Internal fragmentation
Thrashing

Thrashing

Explanation

Thrashing occurs when a process spends most of its time swapping pages because it lacks enough frames. A single page fault is an individual event, internal fragmentation concerns unused space within allocated memory, and segmentation is a memory-management scheme.

11. When processes spend most of their time paging during thrashing, what happens to CPU utilization?

It remains high because memory use increases.
It becomes low because little useful work is done.
It becomes high because page transfers use the CPU.
It rises because more processes finish per unit time.

It becomes low because little useful work is done.

Explanation

Thrashing lowers CPU utilization because processes spend much of their time paging instead of doing useful work. The CPU is not kept productively busy by page transfers, and increased memory use or process throughput does not describe this effect.

12. What does segmentation do to virtual memory, and what perspective does this organization reflect?

Divides it into segments that reflect the user's view of memory.
Divides it into equal-sized pages that reflect disk-block layout.
Divides it into processes that reflect the CPU scheduling order.
Combines physical frames into regions that reflect device layout.

Divides it into segments that reflect the user's view of memory.

Explanation

Segmentation divides virtual memory into multiple virtual address spaces called segments and reflects the user's view of memory. Equal-sized pages describe paging, while physical frames and scheduling order are not what segmentation organizes.

13. A program issues segmented logical address ⟨3,12⟩\langle 3, 12\rangle. What does the value 1212 represent?

The length of segment 3.
The offset within segment 3.
The physical starting address of segment 3.
The identifier of segment 12.

The offset within segment 3.

Explanation

A segmented virtual address is a pair ⟨s,d⟩\langle s,d\rangle, where ss identifies the segment and dd is the offset within it. The base gives the physical starting address, while the limit gives the segment's length.

14. A segment has base address 900 and limit 80. For logical address ⟨2,25⟩\langle 2, 25\rangle, what should the system do?

Report an error because the offset is below the base.
Translate it to physical address 925.
Report an error because the offset is not the segment limit.
Translate it to physical address 105.

Translate it to physical address 925.

Explanation

The offset 25 is within the segment limit of 80, so the address is valid; the physical address is base plus offset, 900+25=925900+25=925. The limit checks whether the offset is in range, whereas the base supplies the physical starting address.

15. On an Intel Pentium, a virtual address passes first through segmentation and then through paging. What address does each unit produce?

Segmentation produces a physical address; paging produces a linear address
Segmentation produces a linear address; paging produces a physical address
Segmentation produces a page number; paging produces a physical address
Segmentation produces a linear address; paging produces a page number

Segmentation produces a linear address; paging produces a physical address

Explanation

Segmentation translates the virtual address into a linear address, which paging then translates into a physical address. Reversing the stages or substituting a page number confuses the outputs of the two units.

16. Which two memory-management arrangements does the Intel Pentium support?

Pure segmentation and pure paging
Pure paging and paging combined with segmentation
Pure segmentation and segmentation combined with paging
Segmentation combined with paging and paging without segmentation

Pure segmentation and segmentation combined with paging

Explanation

The Intel Pentium supports both pure segmentation and segmentation combined with paging. The other choices either replace one supported arrangement or incorrectly require paging in both.

17. A system has 64-bit virtual addresses, 2048-byte pages, and page tables confined to a single page. If each page-table level uses 9 index bits, how many levels are required?

7 levels
5 levels
8 levels
6 levels

6 levels

Explanation

A 2048-byte page requires 11 offset bits, leaving 53 page-number bits; dividing 53 by 9 and rounding up gives 6 levels. Rounding down gives 5, while counting the offset as page-number bits overestimates the requirement.

18. A system uses 2048-byte pages and 4-byte page-table entries, with each page table confined to one page. How many index bits are needed to select an entry in a page table?

11 bits
7 bits
12 bits
9 bits

9 bits

Explanation

Each table page holds 2048 divided by 4, or 512 entries, and indexing 512 entries requires 9 bits. Eleven bits describes the page offset, while 7 bits results from reversing the division.

Study with flashcards

Lock in the answers with 45 flashcards on Virtual Memory Management.

How many entries does a single-level page table have with a 32-bit virtual address and 4 KB pages?

1,048,576 entries.

How much memory does that page table occupy per process with 4-byte entries?

4 MB.

How does hierarchical paging organize virtual address space?

It divides the virtual address space into multiple page tables, effectively paging the page table itself.

See the flashcards →

Read the study guide

Go over the full study guide for Virtual Memory Management.

Read the study guide →

Related classes

Make your own practice quizzes

Upload your class notes and Revizly writes a practice quiz with explained answers in about a minute.

Quiz maker