RTUComputer ScienceYr 2024 · Sem 52024

Q3Operating System

Question

10 marks

(a) Explain the concept of Memory Management. (b) Discuss Fixed and Variable Partition Memory allocation schemes.

Answer

Memory management allocates physical memory to processes efficiently. Fixed partitioning uses static regions while variable partitioning uses dynamic allocation based on process needs.

Memory Management is the functionality of an OS that handles the allocation and deallocation of physical memory (RAM) to processes. The main goals of memory management are: (1) Relocation — a program can be placed anywhere in memory and must be able to run correctly. (2) Protection — a process should not be able to access another process's memory. (3) Sharing — multiple processes should be able to share common data/code. (4) Logical organization — support the program's logical structure (segments, modules). (5) Physical organization — manage data flow between main memory and disk.

Address binding converts logical addresses (used by programs) to physical addresses (actual hardware addresses). It can occur at compile time, load time, or execution time. Modern systems use execution-time binding with hardware support (MMU — Memory Management Unit).

In Fixed Partition (Static) allocation, memory is divided into a fixed number of partitions at system boot time. Each partition has a fixed size and can contain exactly one process. The OS maintains a table of partitions (size, status — free/busy).

Fixed and Variable Partition Memory Allocation
Figure 4: Fixed Partition vs Variable Partition Memory Allocation
  • Equal-size partitions: Any process whose size ≤ partition size can use any free partition. Simple but inflexible — large processes may not fit.
  • Unequal-size partitions: Partitions of different sizes. Processes are assigned to the smallest partition that fits (best fit within partitions).
  • Advantage: Simple to implement; OS overhead is low.
  • Disadvantage: Internal Fragmentation — partition may not be fully used. Degree of multiprogramming is limited to the number of partitions. Large processes may not fit at all.
  • Example: IBM OS/MFT (Multiprogramming with a Fixed number of Tasks).

In Variable Partition (Dynamic) allocation, partitions are created at runtime as processes arrive. Memory is allocated exactly as much as a process needs. As processes finish, their memory is freed, creating holes of various sizes.

  • Allocation Strategies: First Fit (allocate first hole that is big enough — fastest), Best Fit (allocate smallest hole that fits — minimizes wasted space but leaves tiny unusable holes), Worst Fit (allocate largest hole — leaves largest remaining hole for future use; generally worst performer).
  • Advantage: No internal fragmentation; supports larger processes.
  • Disadvantage: External Fragmentation — over time, free memory breaks into many small holes that individually cannot satisfy requests. Compaction (shuffling processes to consolidate holes) requires relocation support and is time-consuming.
  • Example: IBM OS/MVT (Multiprogramming with a Variable number of Tasks).

Modern OS use paging and segmentation rather than contiguous partitioned allocation to eliminate external fragmentation and provide flexible memory management. The concepts of fixed and variable partitioning are foundational for understanding why paging and segmentation were developed.

Back to Paper