Memory Management in Operating System (original) (raw)

Last Updated : 16 Jan, 2026

Memory management is the process of controlling and organising a computer’s memory by allocating portions, called blocks, to different executing programmes to improve the overall system performance.

memory-tree

Memory Management

Techniques in Memory Allocation

Used by an operating system to efficiently allocate, utilize, and manage memory resources for processes. Various techniques help the operating system manage memory effectively. They can be broadly categorized into:

ggg

Swapping

Swapping is a memory management technique where processes are temporarily moved between main memory and secondary storage to free up memory for other processes.

Contiguous Memory Allocation

Each process is allocated a single continuous block of memory. All instructions and data of a process are stored in adjacent memory locations.

Single Contiguous Memory Allocation

Simplest form of memory management. In this technique, the main memory is divided into two parts:

**Characteristics

**Advantages

**Disadvantages

Partitioned Memory Allocation

Main memory is divided into multiple contiguous partitions, and each partition can hold one process. This technique supports multiprogramming.

Partitioned memory allocation is further classified into:

**Fixed Partition Allocation

**Starting Address of Partition **Size of Partition **Status
0k 200k allocated
200k 100k free
300k 150k free
450k 250k allocated

**Variable Partition Allocation

**Advantages

**Disadvantages

Non-Contiguous Memory Allocation

Memory management technique in which a process is divided into smaller parts and these parts are stored in different, non-adjacent locations in main memory. Unlike contiguous allocation, the entire process does not need to be placed in a single continuous block of memory.

This technique is widely used in modern operating systems because it improves memory utilization and reduces fragmentation problems.

Features of Non-Contiguous Memory Allocation

Advantages

Disadvantages

Techniques Used in Non-Contiguous Memory Allocation

  1. **Paging: Divides a process into fixed-size pages and memory into frames of the same size
  2. **Segmentation: Divides a process into logical segments of variable size such as code, data, and stack
  3. **Segmentation with Paging: Combines logical segmentation with paging to reduce fragmentation

Memory Management Mechanisms

Virtual Memory

Page Replacement Algorithms(PRA)

Demand Paging

Memory Management Problems

Fragmentation

Thrashing

Memory Allocation Strategies

**Fixed Partition Allocation: Memory is divided into fixed-sized partitions, and each partition can hold only one process. The OS keeps track of free and occupied partitions using a partition table.

**Dynamic Partition Allocation: Memory is divided into variable-sized partitions based on the size of the processes. This helps avoid wastage of memory but can result in fragmentation.

**Placement Algorithms: When allocating memory, the OS uses placement algorithms to decide which free block should be assigned to a process: