Skip to main content

Chapter 04 · Watch, then practise

Memory Management

Watch the related lecture, then read the question and answer below.

10 questions · 9 playlist videos. Matches are based on video titles; broader background matches are labeled.

Open the full chapter playlist ↗

Topic matches: fixed/variable partitioning and optimal page replacement. The partitioning lecture comes from the supplied Chapter 5 playlist. Numerical examples may differ from this question.

1. Partitioning and optimal page replacement — 2075 Bhadra

Differentiate fixed and variable partitioning. Apply optimal page replacement to the reference string below using four frames.

Answer

Fixed partitioningVariable partitioning
Memory is divided into fixed-size partitions, each holding one process.A partition is created according to a process's requirements.
The number of resident processes is limited by the partitions.The number depends on process sizes and available memory.
Small processes can waste space within a partition.Allocating according to need uses space more efficiently for small processes.

Reference string: 0, 9, 0, 1, 8, 1, 8, 7, 8, 7, 1, 2, 8, 2, 7, 8, 2, 2, 8, 3.

The source reports 7 page faults. The original replacement table and calculation are preserved without recalculation:

Partition comparison and optimal replacement table

Optimal result and next replacement exercise

Topic matches: thrashing, FIFO/LRU/optimal replacement, and LFU. These are algorithm explanations, not verified solutions to the exact reference string.

2. Thrashing and replacement algorithms — 2074 Bhadra

What is thrashing? Apply FIFO, optimal, LRU, and LFU page replacement with three frames to the reference string in the original question.

Answer

Thrashing occurs when excessive paging or swapping leaves little time for useful execution. Processes competing for memory suffer frequent page faults and poor performance.

The source reports FIFO 15, optimal 9, LRU 12, and LFU 13 page faults. The reference string, all frame tables, and working are preserved below; these are source results rather than independently validated calculations.

Thrashing question, reference string, FIFO and optimal working

LRU and LFU working

Topic matches: compaction/coalescing, paging, and logical-to-physical address calculations.

3. Compaction, coalescing, and paging — 2073 Bhadra

Differentiate compaction and coalescing. Explain logical-to-physical address translation using paging with an example.

Answer

Compaction moves processes to combine free memory into a larger region and consumes CPU time. Coalescing joins adjacent free regions without moving the allocated processes, requiring less work.

Paging divides physical memory into fixed-size frames and logical memory into pages of the same size. A logical address contains a page number and an offset. The page number indexes the page table to obtain a frame number; the frame number and offset identify the physical location. The source illustrates a 16-bit address and 4 KB pages, giving a 12-bit offset and a 4-bit page number.

The source's written address expression is reproduced as an image; it should not be read as a verified arithmetic formula.

Original paging formulas, translation diagram, and example

Covers FIFO replacement. Coverage of Belady’s anomaly and this exact reference string has not been verified.

4. FIFO and Belady's anomaly — 2073 Bhadra

Demonstrate Belady's anomaly using FIFO with three and four frames.

Reference string: 3, 2, 1, 0, 3, 2, 4, 3, 2, 1, 0, 4, 2, 3, 2, 1, 0, 4.

Answer

The source's tables report 14 faults with three frames and 15 with four frames, illustrating an increase in faults despite adding a frame. Original tables and formulas:

FIFO and Belady's anomaly working

Topic matches: page faults and the requested replacement algorithms. The worked numerical examples may differ.

5. Page faults and replacement comparison — 2073 Magh

Under what circumstances does a page fault occur? Apply LRU, FIFO, and optimal replacement with three frames to the given reference string.

Answer

A page fault occurs when an accessed page is absent from main memory. The OS checks whether the access is valid, aborting an invalid access. Otherwise it obtains a frame, reads the page from backing storage, updates process and page-table information, and restarts the interrupted instruction.

Reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.

The original answer reports LRU 14, FIFO 15, and optimal 11 faults. Exact working:

Page-fault explanation and LRU/FIFO tables

Optimal table and demand-paging question

Topic matches: demand paging, page faults, and address-translation numericals. The exact address and page table are retained in the answer.

6. Demand paging and address translation — 2072 Ashwin

Define page fault and demand paging. A logical address space has eight pages of 8 KB each, with sixteen physical frames. Use the supplied page table to translate logical address 18325.

Answer

Demand paging loads a page only when a process accesses it. Accessing a page not currently in memory causes a page fault.

The source's page table maps pages 7, 6, 5, 4, 3, 2, 1, 0 to frames 10, 4, 0, 7, 13, 11, 14, 5 respectively. Its working uses 3 page bits, 13 offset bits, and 4 frame bits. Logical address 18325 selects page 2 and frame 11; the source obtains physical address 92053.

The original binary expressions, page table, and arithmetic are preserved here:

Original address-translation question and page table

Original binary address-translation calculation

Replacement-algorithm background. The source does not supply a separate worked answer for this reference string.

7. Repeated replacement question — 2072 Magh

Apply the requested replacement algorithms to the reference string:

1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.

Answer

Answer in the source: An arrow refers to the 2073 Magh solution, reproduced as Question 5.

The written reference string contains additional references and is not identical to Question 5. No separate worked solution is supplied; the earlier fault counts should not automatically be applied to this different string. The exact handwritten question is preserved below.

Original repeated page-replacement question

Background on paging only. No dedicated TLB video is listed in the supplied chapter playlist.

8. Translation lookaside buffer — 2071 Bhadra

Explain the role of a TLB.

Answer

A translation lookaside buffer is a cache holding recent virtual-to-physical address translations. Looking up a translation in the TLB reduces the memory accesses required for address translation.

Covers logical/physical address calculations. No dedicated resident-monitor video is listed in the supplied playlist.

9. Resident monitor and address sizes — 2071 Magh

Explain a resident monitor. A logical address space has eight pages of 1024 words each, mapped into a physical memory of 32 frames. How many bits are required for logical and physical addresses?

Answer

A resident monitor was an early operating-system precursor that remained in memory. It loaded nonresident programs and handled setup and cleanup between jobs. The source discusses its use in early computer systems.

The source assigns 3 page-number bits, 10 offset bits, and 5 frame-number bits. It gives 13 bits for a logical address and 15 bits for a physical address. Original formulas:

Resident-monitor question and explanation

Address-size formulas and replacement question

Topic match: FIFO, LRU, and optimal page replacement. The video’s examples are not verified solutions to this exact reference string.

10. FIFO, LRU, and optimal replacement — 2070 Bhadra

Use three frames for the reference string 2, 3, 5, 4, 2, 5, 7, 3, 8, 7 and compare FIFO, LRU, and optimal replacement.

Answer

The source reports FIFO 8 faults / 2 hits, LRU 8 faults / 2 hits, and optimal 7 faults / 3 hits. All original table entries and calculation steps are retained:

FIFO replacement working

LRU and optimal replacement working

More videos from this chapter’s playlist

These playlist videos do not have a direct match among the questions above.