📝 Virtual Memory examples in Solaris (12 MCQs)
Virtual Memory Organisation in Oracle Solaris
Oracle Solaris provides a Unix-based example of virtual-memory management through address-space mappings, demand paging, page caching, and physical-memory reclamation. Its memory-management subsystem supports process isolation and file-backed as well as anonymous memory. The kernel coordinates page tables, resident physical frames, backing storage, and memory-reclamation policies. Specific mechanisms and tuning parameters differ across Solaris releases and supported processor architectures.
Why Solaris Separates Virtual Memory from Physical Placement
Applications require large and independent address spaces even when physical memory is limited or fragmented. Solaris uses virtual-memory mappings to associate process addresses with physical pages and backing objects. File-backed memory can be retrieved from files, while anonymous memory requires other backing arrangements when it is not resident. This separation allows flexible allocation, sharing, and process execution without contiguous physical placement.
Page Faults, Address-Space Objects and Reclamation
When a process references a nonresident mapped page, the kernel handles a page fault and locates the page through its associated backing object. It obtains a physical frame, retrieves or initialises the contents, and establishes the mapping. Under memory pressure, Solaris reclaims eligible pages, writes modified anonymous contents when necessary, and preserves recoverable file-backed data through its storage association.
Handling a File-Backed and Anonymous Page
Suppose a Solaris process accesses a mapped file page that is not resident. A page fault causes the relevant file contents to be brought into memory. If the process instead accesses a newly allocated anonymous page, the system can provide zero-initialised contents. These cases illustrate how backing-object information determines the source of page contents during demand paging.
Memory Reclamation and Storage-Backed Performance
Solaris combines virtual-memory mapping with memory-reclamation mechanisms to balance resident pages and available frames. File-backed pages may be discarded when their original contents remain recoverable, while modified anonymous pages require suitable backing. Reclamation activity can increase storage traffic and affect response time under memory pressure. Exact paging behaviour, scanner policies, and tuning thresholds depend on the Solaris version and configuration.
Clarifying Solaris Page Sources and Residency
'Every nonresident page must be restored from a swap file' is incorrect because file-backed pages can be reread from their original files. 'A page fault always indicates an invalid address' is incorrect because valid mappings can be nonresident. 'The Solaris memory manager uses identical policies in every release' is incorrect because implementation details and tuning mechanisms vary across versions.
Exam Focus: File-Backed and Anonymous Memory
Distinguish file-backed pages from anonymous memory and identify the appropriate source used when a nonresident page is retrieved. Trace the fault-handling and frame-allocation sequence. Explain why modified anonymous pages require backing while clean file-backed pages may be reread from their files. Avoid applying version-specific Solaris tuning details to every implementation.
Key Terms of Solaris Virtual Memory
- Oracle Solaris - Unix-based operating system.
- Anonymous memory - Memory without a regular file backing.
- File-backed page - Page associated with a file.
- Page fault - Exception for unavailable page contents.
- Page reclamation - Recovers physical memory.
- Backing store - Holds nonresident memory contents.
📝 All Virtual Memory examples in Solaris MCQs
Q1. What does the modify (dirty) bit indicate for a page in Solaris virtual memory?
📖 Explanation: The modify (dirty) bit is set by hardware whenever a write occurs to any byte of a page, meaning the page has been changed after being brought into memory. Therefore option B correctly describes its purpose. Option A confuses the bit with a lock mechanism, which Solaris does not provide. Option C describes read‑only status, which is unrelated to the dirty bit. Option D suggests an ongoing swap operation, which the bit does not indicate. Recognizing the dirty bit helps the OS decide whether a page must be written back to disk during replacement, reducing unnecessary I/O.
Q2. How does checking the modify bit before selecting a victim frame affect the number of disk I/O operations during a page fault?
📖 Explanation: When the OS examines the modify bit, it learns whether the selected victim page has been altered. If the bit is clear, the page is clean and does not need to be written back, so only one I/O (the page‑in) is required. This matches option C. Option A is opposite of the actual behavior; the bit allows skipping writes. Option B misstates the effect, as checking the bit does not increase page‑ins. Option D exaggerates the cost; the OS checks the bit of the chosen victim, not all pages. By avoiding unnecessary writes, the system reduces latency and improves overall performance.
Q3. In the page‑fault service routine, what is the first step after a fault is detected?
📖 Explanation: The service routine must first determine where the needed page resides on secondary storage before any frame can be allocated. This location step is essential to later read the page into memory, making option A correct. Option B occurs only after a free frame is unavailable. Option C follows the victim selection, not the initial step. Option D is unrelated to page handling; the program counter is resumed after the page is loaded. Understanding the order of actions ensures the OS follows the correct sequence, preventing wasted I/O and maintaining process continuity.
Q4. Why can read‑only pages be discarded without writing them back to disk during replacement?
📖 Explanation: Read‑only pages, such as code segments, are never altered by the process. Since the modify bit remains clear, the OS knows the in‑memory copy matches the copy on disk, allowing it to discard the frame without a write‑back. This matches option D. Option A is false because read‑only pages are indeed loaded into RAM for execution. Option B is not a Solaris mechanism; duplication is not assumed. Option C misrepresents hardware behavior; restoration still requires reading from disk if needed later. Recognizing this property lets the system skip unnecessary writes, reducing page‑fault service time.
Q5. If no free frames exist, how many disk transfers are required to service a page fault, and what is the impact on effective access time?
📖 Explanation: When all frames are occupied, the OS must evict a victim page (write it out if dirty) and then read the needed page, resulting in two separate disk operations. This doubles the time spent handling the fault compared with a single transfer, making option B correct. Option A understates the work; one transfer would occur only if a free frame existed. Option C exaggerates the number of transfers. Option D ignores the need for replacement. The doubled I/O cost directly increases the effective access time, highlighting why minimizing replacements is important for performance.
Q6. A system has four frames occupied as follows: Frame 1 (clean), Frame 2 (dirty), Frame 3 (clean), Frame 4 (dirty). A page fault occurs for a new page. Which frame should the OS select to minimize disk I/O?
📖 Explanation: Selecting a clean frame avoids the need to write its contents back to disk before loading the new page, reducing I/O to a single read operation. Both Frame 1 and Frame 3 are clean, but either choice yields the same benefit; the question asks for a specific option, and Frame 1 is listed first, making option A correct. Options B and D are dirty, requiring an extra write‑back, increasing I/O. Option C is also clean, but the answer key chooses Frame 1. This scenario shows how the modify bit guides victim selection to improve performance.
Q7. Suppose memory access time is 100 ns, page‑fault service time without a dirty write is 8 ms, and with a dirty write is 12 ms. If the fault rate is 0.001, what is the approximate effective access time (EAT) using the dirty‑write scenario? (Use )
📖 Explanation: Convert units: 100 ns = 0.0001 ms. Using , , which is about 12.1 ms. Option C matches this calculation. Option A mistakenly treats the result as microseconds. Option B is off by a factor of 1000. Option D adds the fault time incorrectly without scaling by the fault rate. This calculation illustrates how even a tiny fault probability can dominate total latency when fault service times are large, emphasizing the importance of reducing dirty writes.
Q8. If a process frequently writes to a specific page, how does the modify bit influence the page‑replacement decision for that page?
📖 Explanation: A page that has been written to many times will have its modify bit set, indicating it is dirty. Evicting such a page requires a write‑back, which is expensive, so the replacement algorithm tends to avoid selecting it as a victim, aligning with option D. Option A is inaccurate; the OS may still replace the page if necessary. Option B contradicts the dirty status. Option C misstates the policy; dirty pages are typically deprioritized, not prioritized for removal. Understanding this behavior helps system designers predict performance impacts of write‑heavy workloads.
Q9. Which of the following algorithms best incorporates the modify bit to reduce I/O while still approximating LRU behavior?
📖 Explanation: An LRU‑Clock algorithm maintains a circular list like Clock, but when choosing a victim it first checks the modify bit and prefers clean pages, thereby reducing write‑backs while still approximating LRU ordering. This matches option B. Pure LRU (A) does not consider the dirty bit and may cause unnecessary writes. FIFO (C) also ignores modify status and can be inefficient. Random replacement (D) checks the dirty bit only after a random choice, potentially leading to extra writes. By integrating the modify bit, the LRU‑Clock variant balances recency with I/O cost, improving overall system throughput.
Q10. During a heavy write workload, which modification to Solaris’s LRU page‑replacement policy yields the greatest throughput improvement?
📖 Explanation: A second‑chance (or Clock) algorithm gives dirty pages an extra opportunity before eviction, allowing the system to potentially find a clean page later and thus avoid costly writes. This approach (option D) often yields the best throughput under write‑intensive conditions. Option A discards useful I/O reduction information. Option B forces eviction of dirty pages, increasing write‑backs. Option C may repeatedly skip dirty pages, leading to starvation of heavily used pages. The second‑chance modification leverages the modify bit to balance recency with write cost, enhancing performance.
Q11. Compared with a simple FIFO replacement strategy, Solaris’s page‑replacement method that uses the modify bit:
📖 Explanation: Solaris’s method checks the modify bit and will discard a clean page without writing it back, thereby avoiding unnecessary disk writes—exactly what option A states. FIFO replaces pages purely by arrival order, regardless of dirty status, so it may incur extra writes. Option B is false; FIFO replaces the oldest, not newest. Option C is unrelated; the modify‑bit approach does not need timestamps. Option D mischaracterizes the algorithm; while it may not track exact order like LRU, it still considers access patterns indirectly. This distinction highlights why modify‑bit awareness improves efficiency.
Q12. In a low‑memory environment, what is the primary trade‑off when relying heavily on the modify bit to select victim pages?
📖 Explanation: When memory is scarce, the system may frequently need to replace pages. Prioritizing clean pages (using the modify bit) can lead to selecting pages that have not been used recently, potentially increasing the time to read the needed page back into memory, which aligns with option C. Option A misstates the cost; checking a single bit is cheap. Option B concerns thrashing, which is more about replacement frequency than dirty‑bit policy. Option D is incorrect; page tables remain essential. Understanding this trade‑off helps administrators balance I/O savings against possible latency increases in constrained systems.)