OS Module Bank 2 H Sectioin
OS Module Bank 2 H Sectioin
1) A) Memory management is a crucial component of an operating system that determines how memory
is allocated, utilized, and deallocated. Illustrate the key objectives of memory management in modern
operating systems. Describe the differences between logical memory and physical memory with real-
world examples. Discuss the challenges of memory fragmentation and how it affects system performance.
B) A system with 256 MB of RAM is running three processes with the following memory requirements:
Process Memory Required (MB)
P1 80
P2 120
P3 60
The OS uses Contiguous Memory Allocation and follows the First-Fit, Best-Fit, and Worst-Fit strategies
for memory allocation. Simulate memory allocation using all three strategies. Show the memory
partitioning diagrams for each approach. Identify external fragmentation and wasted memory in each
case.
C) Which strategy resulted in the most efficient memory utilization, and why? If a new process (P4) with
50 MB memory arrives, which strategy would handle it best? Suggest improvements such as paging or
segmentation that could optimize memory allocation in high-performance systems.
2) A) Describe the concept of swapping in memory management and its role in handling processes in an
operating system. How does swapping impact system performance, CPU utilization, and response time?
In a multi-user cloud computing environment, what challenges arise due to excessive swapping, and what
strategies can be used to minimize performance degradation?
B) Consider a system with 4 processes (P1, P2, P3, P4) and a total available memory of 300 MB. The
processes arrive in the following order:
Process Memory Required (MB) Execution Time (ms)
P1 150 300
P2 100 250
P3 200 400
P4 50 150
Implement a swapping mechanism where processes are moved in and out based on memory availability.
Track when a process is swapped out and when it is brought back into memory.
Display the memory utilization timeline.
C) What was the impact of swapping on turnaround time and CPU utilization? If frequent swapping
caused performance degradation, what alternative memory management techniques could be
implemented? How could techniques like demand paging or priority-based swapping improve overall
system efficiency?
3) A) Contiguous memory allocation assigns a single continuous block of memory to a process, making it
simple and fast. However, it can lead to fragmentation and inefficient memory utilization. Discuss the
differences between internal and external fragmentation in contiguous allocation and how they affect
system performance. What strategies can be used to reduce fragmentation in contiguous memory
allocation?
B) Consider a system with 500 MB of total memory, where processes arrive and request memory as
follows:
Process Memory Required (MB)
P1 200
P2 100
P3 50
P4 150
The system initially has 500 MB of free memory but as processes complete, memory holes are created.
Implement First-Fit, Best-Fit, and Worst-Fit memory allocation strategies to allocate memory for the
processes. Show the memory allocation diagrams for each strategy. Identify wasted memory
(fragmentation) in each case.
C) Compare the results of the three strategies in terms of memory utilization, fragmentation, and process
allocation efficiency. Which strategy was most effective in reducing fragmentation, and why? Suggest
improvements or alternative memory management techniques, such as paging or compaction, to optimize
contiguous memory allocation.
4) A) Paging is a memory management technique that eliminates external fragmentation by dividing
memory into fixed-size blocks. However, maintaining page tables introduces overhead. Describe the
structure and purpose of a page table in paging. How do single-level, multi-level, and inverted page tables
differ in terms of memory overhead and lookup efficiency?
B) Consider a system with a logical address space of 32 KB and a page size of 4 KB. A process generates
the following logical addresses:
(5, 100), (3, 700), (7, 50), (2, 1024), (6, 500)
Each tuple represents (page number, offset). Given the page table mapping:
Page Number Frame Number
0 4
1 7
2 1
3 5
4 2
5 3
6 6
7 0
Convert each logical address into a physical address using the page table. Show the logical-to-physical
address translation process.
C) Compare single-level, two-level, and inverted page tables in terms of speed, memory consumption,
and suitability for large address spaces. Which page table structure is best suited for a high-performance
database system, and why? Suggest hardware-based optimizations, such as TLB (Translation Lookaside
Buffer), to speed up address translation.
5) A) Describe the differences between paging and segmentation in terms of memory utilization,
fragmentation, and address translation. What are the advantages of segmentation in program execution
and modularity?
B) Consider a process with the following segmentation table:
Segment Base Address Limit (Size in Bytes)
0 1000 400
1 1500 600
2 2500 300
3 3000 500
A program generates the following logical addresses (segment, offset):
(1, 200), (2, 50), (3, 450), (0, 500), (2, 350)
Convert these logical addresses into physical addresses using the segmentation table. Identify any invalid
accesses that cause segmentation faults.
C) Analyze the results in terms of memory efficiency and fragmentation. How does segmentation handle
program modularity better than paging? In modern systems, segmentation is often combined with paging
—explain why hybrid paging-segmentation is useful for managing large and complex applications.
6) A) In an online video streaming platform, memory management plays a crucial role in caching and
retrieving video content efficiently. Describe how demand paging helps in managing memory efficiently.
Discuss the impact of page faults and how they affect system performance.
B) Suppose a streaming server has four memory frames available and receives the following sequence of
page requests representing video chunks:
2, 3, 2, 1, 5, 2, 4, 5, 3, 2, 5, 2, 3, 4, 1, 5, 6, 2, 3, 1, 2, 4, 5.
Implement FIFO and LRU page replacement algorithms. Show the sequence of page faults and display
the page replacement table. Calculate the page fault rate for both algorithms.
C) Compare FIFO and LRU based on the number of page faults observed. Which algorithm performs
better for the given scenario? Discuss when FIFO may lead to poor performance (Belady’s Anomaly).
Suggest an improvement that could reduce the number of page faults and enhance video streaming
performance.
7) A) A banking system handles multiple ATM transaction requests that involve disk operations such as
reading account balances, updating transactions, and logging customer activity. Disk scheduling is crucial
for optimizing the response time of these transactions. Discuss the role of disk scheduling in improving
transaction processing efficiency. Compare the advantages and disadvantages of FCFS, SSTF, and SCAN
scheduling algorithms.
B) Consider the following set of disk requests arriving at different times (cylinder numbers to be
accessed):
98, 183, 37, 122, 14, 124, 65, 67
The initial position of the disk head is at 53. Implement FCFS, SSTF, and SCAN disk scheduling
algorithms. For each algorithm, generate the disk movement sequence (Gantt chart representation).
Calculate the total seek time for each algorithm.
C) Compare the performance of the three algorithms in terms of seek time. In a banking system where
quick response time is needed for critical transactions, which algorithm is more suitable? Suggest an
adaptive disk scheduling strategy that could dynamically switch between algorithms based on system
load.
8) A) Different file allocation strategies impact file retrieval speed, fragmentation, and space utilization.
A cloud storage service (like Google Drive or Dropbox) must choose between Contiguous, Linked, and
Indexed allocation for managing user files. Decribe each file allocation method with its advantages and
disadvantages. Discuss which allocation method would be best suited for cloud storage systems and why.
B) Consider the following files with given sizes that need to be stored on a disk (assuming block size = 4
KB):
File Size (KB)
A 12
B 20
File Size (KB)
C 8
D 28
Simulate how these files would be allocated in Contiguous, Linked, and Indexed methods. Represent the
disk layout for each method. Calculate the amount of wasted space (fragmentation) for each method.
C) Based on your results, which allocation method is the most efficient in terms of retrieval speed and
space utilization? Discuss a hybrid approach that combines the strengths of multiple allocation methods to
enhance file system performance. How can dynamic space allocation techniques help in reducing
fragmentation?
9) A) A multiplayer online gaming platform needs an efficient memory management system to handle
game states, player data, and background processes. Two major memory management schemes—Paging
and Segmentation—are available. Discuss the differences between paging and segmentation in terms of
memory access speed, fragmentation, and flexibility. Which method would be more suitable for a real-
time gaming environment, and why?
B) Consider a system with 4 KB page size and the following logical addresses to be mapped to physical
memory:
(5, 200), (8, 1023), (2, 150), (4, 500), (6, 1800).
(Each tuple represents (page/segment number, offset)).
Implement a paging scheme to translate these logical addresses into physical addresses using a given page
table. Now, implement segmentation for the same set of addresses and generate the corresponding
physical address mapping. Compare the translation results for both methods.
C) Based on the results, which approach resulted in less fragmentation? In a game development
environment, which method should be used to optimize performance and memory utilization? Suggest an
enhanced hybrid approach that combines paging and segmentation for better memory efficiency in real-
time applications.
10) A) A web server hosting multiple active websites relies on virtual memory for efficient process
execution. When multiple users access pages, page replacement algorithms determine which memory
pages to keep or replace. Describe the role of page replacement algorithms in virtual memory
management. Compare Optimal, FIFO, and LRU in terms of page fault frequency and performance.
B) A process generates the following page reference sequence: 7, 0, 1, 2, 0, 3, 4, 2, 3, 0, 3, 2, 1, 2, 0, 1, 7,
0, 1. The system has 3 memory frames available. Implement FIFO, LRU, and Optimal page replacement
algorithms. Generate the page replacement table for each algorithm. Calculate the total number of page
faults for each method.
C) Which algorithm resulted in the fewest page faults, and why? In a real-world cloud-hosting
environment, which method would be most effective for handling dynamic user traffic? Suggest a hybrid
or adaptive approach that optimizes page replacement based on real-time workload conditions.