Introduction to Operating Systems: Unit III: Memory Management

Contiguous Memory Allocation with Fixed Size Partitions

Memory Management - Introduction to Operating Systems

In a fixed size partitioning of the main memory all partitions are of the same size. The operating system divides main memory into a number of fixed size partition. Each partition holds a single program.

Contiguous Memory Allocation with Fixed Size Partitions

• In a fixed size partitioning of the main memory all partitions are of the same size. The operating system divides main memory into a number of fixed size partition. Each partition holds a single program.

• Fixed sized partitions are relatively simple to implement. Degree of multiprogramming depends on the number of partitions.

• Normally main memory is divided into two partitions :

1. For resident program

2. For user processes

• Batch operating system uses the fixed size partition scheme. The operating system keeps the record of memory allocation and deallocation in the form of table. Initially all the memory is available for user processes.

• When the process arrives in the system and needs memory, operating system search for large hole for this process. Hole is one large block of free available memory. If any free hole is found, process is allocated to the free hole of memory as is needed.

• After allocating number of holes for the processes, a set of various size holes is scattered throughout memory at any given time. When a process arrives and searches for (memory) set of holes. But the holes must be large enough to accomodate the process.

• Fixed sized partitions are simple to implement. Any process whose size is less than or equal to the partition size can be loaded into any available partition.

• Fig. 4.3.1 shows an example of fixed partitioning of a memory.

There are two difficulties with the use of equal size fixed partitions :

1. A program may be too big to fit into a partition.

2. Memory utilization is extremely inefficient.

First difficulty is solved by using overlays. Overlays involves moving data and program segments in and out of memory.

Advantages and disadvantages of fixed partition size

1) Advantages

1. Simple to implement.

2. Does not require expertise to understand and use such a system.

3. Less overhead.

2) Disadvantages

1. Memory is not fully utilized.

2. Poor utilization of processors.

3. User's process being limited to the size of available main memory.

4. Requires contiguous loading of entire program.

Dynamic Memory Partitions

• Memory partitions are of variable length and number. Processes are loaded into the size nearest to its requirements.

• Fig. 4.3.2 shows the effect of dynamic memory partitioning. Initially in main memory, only OS is loaded and rest of the memory is free. Memory size is 64 Mbytes. How the process is loaded with dynamic partitions is shown below. After loading all the process some free space remains at one side of the

Four process/programs are loaded into memory. These program starts loading where the OS ends. After loading four programs, it leaves a hole at the end of memory that is too small for a next process.

• Operating system swap out program 2 and leaves sufficient room to load new program into memory. The size of newly loaded program is smaller than the program in memory. Again another small hole is created.

Memory Protection and Mapping

• Memory allocated to the process need to be protected against interference by other processes. Memory protection provides this facility.

• Relocation register and limit register are used for memory protection. Physical address is stored in the relocation register and range of virtual address is stored in the limit register.

• Fig. 4.3.3 shows logical address space.

• Use of registers method for memory protection requires proper arrangement. This method has to be used individually for each memory area allocated to a process.

• Every logical address generated by the CPU is checked against these registers. A protection violation interrupt is raised if any of these checks fail.

• Operating system load a base register and limit register. OS uses privileged instruction for this purpose. Operating system executes in monitor mode and privilege instruction also executes in privilege mode.

Fig. 4.3.4 shows memory protection by using relocation and limit registers.

• Operating system prevents the user programs from changing the content of the registers. While executing in the monitor mode, operating system is given unrestricted access to both monitor and user's memory.

• In a multiprogramming environment, protection of main memory is essential. Paging or segmentation or both in combination provides an effective means of

• An example of the hardware support that can be provided for memory protection is that of the IBM system/370 family of machines, on which VMS runs. Microsoft Windows 3.1/95 offer memory protection. Microsoft WinNT also offers memory protection. In UNIX, almost impossible to corrupt another process memory.


University Question

1. Discuss the given memory management technique with diagram: Partition Allocation Methods. AU May-17, Marks 8

Introduction to Operating Systems: Unit III: Memory Management : Tag: : Memory Management - Introduction to Operating Systems - Contiguous Memory Allocation with Fixed Size Partitions