True or false: Threads belonging to the same process typically share its address space.
6 Memory Management and Virtual Memory Online Quiz Questions
Use this free practice quiz with 20 questions to review 6 Memory Management and Virtual Memory, test your knowledge, and prepare for your next test or exam.
True or false: If a process accesses an address that violates the page’s permissions, the operating system handles it by loading the page into RAM and restarting the instruction.
- A
True
- B
False
What is the main role of a translation lookaside buffer (TLB) during memory access?
- A
It stores modified file contents until they are written to backing storage.
- B
It caches recent virtual-to-physical address translations.
- C
It divides a process’s address space into variable-sized logical regions.
- D
It allocates requested blocks within a program’s runtime.
With 4 KiB pages, virtual address 0x12345 has virtual page number 0x12 and offset 0x345. If page 0x12 maps to physical frame 0x2A, what physical address results?
- A
0x12345 - B
0x2A345 - C
0x2A12 - D
0x3452A
A program reads from a file-backed region of its address space, but the needed file page is not currently in RAM. What is a likely result of that first access?
- A
The program must first copy the file into its own buffer using physical disk addresses.
- B
Every read from the mapped region causes a page fault, even after the page is in RAM.
- C
The first access can cause a page fault that prompts the operating system to load the relevant file data and establish the mapping.
- D
The mapping gives the program direct control over which physical disk and RAM locations hold the data.
Select all statements that correctly describe paging.
- A
Virtual address spaces are divided into fixed-size pages, and physical memory into same-sized frames.
- B
Each virtual page must occupy a physically contiguous region whose size matches the entire address space.
- C
A page table records which physical frame, if any, holds each virtual page.
- D
Paging avoids external fragmentation in physical-memory allocation because any available frame can hold a page.
- E
Paging guarantees that no space inside an allocated region is ever unused.
Select all statements that accurately describe virtual memory and file-backed mappings.
- A
A process’s address space can be larger than the portion of it currently resident in RAM.
- B
Every region in a process’s address space must be backed by swap space.
- C
Two processes can map the same read-only program-file pages while keeping separate private data.
- D
File-backed mappings can connect a file to a process’s virtual address space.
- E
Virtual memory makes disk access as fast as access to RAM.
In a simple segmentation model, a segment has base 1000 and limit 300. A valid address uses offset 240. What physical address results? Enter a decimal number.
In paging, virtual address spaces are divided into fixed-size , while physical memory is divided into same-sized .
When a process accesses a valid page that is not resident in RAM, the operating system often , , and then .
Describe the roles of the code, global-data, heap, and stack regions commonly found in a process’s address space. Explain how the heap and stack differ.
A program requests memory through a runtime allocator such as malloc. Which task is most directly associated with that allocator?
- A
The runtime allocator maps virtual pages to physical frames and enforces process permissions.
- B
The runtime allocator manages requested blocks and may obtain larger regions from the operating system.
- C
The runtime allocator translates every virtual address directly into a disk location.
- D
The runtime allocator sets the physical base and limit for every process segment.
A program accesses a virtual address in its address space. Which component performs the translation to a physical address in RAM?
- A
The operating system translates physical addresses into virtual addresses before a program uses them.
- B
The MMU translates a process’s virtual addresses into physical addresses.
- C
The runtime allocator translates virtual addresses directly into file offsets.
- D
The page table assigns each process a separate physical RAM chip.
True or false: If a process accesses an invalid address, the operating system handles the resulting page fault by loading that address’s page into RAM.
- A
True
- B
False
Two processes run the same program. Which arrangement can let them share program pages without making their private data the same?
- A
The processes must use identical virtual addresses for all their data.
- B
The operating system copies the entire program into RAM separately for each process.
- C
Both processes can map the same read-only program-file pages while keeping private data separate.
- D
The processes share one address space, so neither can have private data.
A system uses 4 KiB pages. Virtual address 0x12345 is in virtual page 0x12, which maps to physical frame 0x2A. What physical address results?
- A
0x2A123
- B
0x2A345
- C
0x12345
- D
0x3452A
In a simple segmentation model, a process accesses a segment with a base of 8000 and a limit of 1200. Which rule determines whether an offset can be translated?
- A
Translate every offset by adding it to the base, even when it exceeds the limit.
- B
Use the offset as the physical address and ignore the base.
- C
Add the offset to the base only when the offset is within the segment’s limit.
- D
Replace the offset with a page-frame number from the TLB.
What is the term for free memory split into separate pieces that are each too small to satisfy a requested allocation?
What does TLB stand for in the context of address translation?
A variable-sized allocator gives a program a 64-byte block for a 50-byte request. How many bytes of unused space remain inside the allocated block? Enter the number in bytes.