BCA / B.Tech 13 min read

Contiguous Allocation in Operating System

Contiguous Allocation in Operating System:


Memory management is a critical process within an operating system. When a program executes, it needs space in memory (RAM) for its data and instructions. Contiguous Allocation is one of the primary methods for allocating this memory. In contiguous allocation, a process or file is stored in a continuous, unbroken block of memory. The main goal is to ensure that the process or file is stored in a single, continuous memory block, which simplifies data access and can improve performance.

What is Contiguous Allocation?

Contiguous Allocation is a memory allocation technique where a process or file is given a continuous block of memory. This means that when a process needs memory, it is assigned a contiguous memory area where the entire data or file is placed. All the memory blocks are adjacent to each other.

Types of Contiguous Allocation:

1. Fixed-size Partitioning: In this method, memory is divided into several blocks of a predetermined size. Each process is stored in one contiguous block. This method is simple but can lead to wasted memory (internal fragmentation) because small processes might be stored in large blocks.
2. Variable-size Partitioning: In this method, memory is divided into blocks of various sizes. When a process or file needs memory, a suitable block is allocated according to its size. This method is more flexible and makes better use of memory but can suffer from external fragmentation, where small, unused memory blocks are left scattered.

Advantages of Contiguous Allocation:

  • Simplicity: It is a simple method because a process or file is stored in a continuous memory area, making management and tracking easy.
  • Fast Access: Since data is stored in contiguous memory blocks, the CPU can access it quickly, speeding up execution.
  • Direct and Simple Navigation: The file system does not need to navigate between different data blocks, making data easy to find.
  • Low Overhead: It does not require additional data structures to store data, which reduces system overhead.

Limitations of Contiguous Allocation:

  • External Fragmentation: Small, unused memory spaces can be left between allocated blocks. These small free spaces might not be large enough for a new process, leading to wasted memory.
  • Difficulty in Allocation: It can be difficult to store a process if a contiguous block of the required size is not available.
  • Problem with File Growth: If a file grows in size, it might be difficult to find enough continuous space for it.
  • Memory Wastage: If a large block is allocated for a small process, the remaining space in that block is wasted (internal fragmentation).

External Fragmentation in Contiguous Allocation:

External fragmentation is a major problem. A solution is Compaction, a technique where all the small, unused memory blocks are combined to form one large block. Modern operating systems often use more advanced techniques like Paging and Segmentation to solve this problem, as they do not require contiguous allocation.

In this Chapter

Contiguous Allocation in Operating System
Distributed System in Operating System
Real-Time System in Operating System
System Calls in Operating System
System Programs in Operating System
Structure of an Operating System
Layered Design of an Operating System Structure
UNIX in Operating System
Virtual Machine in Operating System
Kernel-Based Operating System
Process Concept in Operating System
Interacting Processes in Operating System
Threads in Operating System
Fundamentals of Scheduling in Operating System
Scheduling Criteria in Operating System
Long, Medium, and Short-Term Scheduling
Scheduling Algorithms in Operating System
Structure of a Concurrent System
Critical Region in Operating System
Critical Section in Operating System
Inter-process Communication (IPC) in Operating System
Monitors in Operating System
Semaphores in Operating System
Semaphore Implementation & Uses in Operating System
Logical and Physical Address in Operating System
Swapping in Operating System
Segmentation in Operating System
Paging in Operating System
Virtual Memory using Segmentation in Operating System
Interprocess Communication Protocol in Operating System
Network Operating System
Design Issues in Distributed File System
Network Structure in Operating System
Structure of a Distributed System
File System and Coordination in Operating System
History of Linux in Operating System
Linux Commands
Programmer Interface & File Manipulation in Linux
Process Control in Linux
Kernel & Signals in Linux
File System in Linux
Blocks and Inodes in Linux
System Editors in Linux
Character Transliteration in Linux
The `ed` Line Editor in Linux
The `vi` Editor and Its Commands
Shell Scripting in Linux
Looping & Decision Making in Linux Shell Scripting
Variables & File Name Expansion in Linux
Arrays in Linux Shell Scripting
Subprograms (Functions) in Linux Shell Scripting
C Interface with Linux
Simple Shell Programs in Linux
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is an Operating System (OS)
Operating System (OS) All Important Questions and Answers in English (MDSU)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Types of Operating Systems
Goals of an Operating System
Operations of an Operating System
Resource Allocation & Functions in an Operating System
Classes of Operating System
Batch Processing in Operating System
Multiprocessing in Operating System
Time-Sharing in Operating System