1. Contiguous Memory Allocation :
Contiguous memory allocation is basically a method in which a single contiguous section/part of memory is allocated to a process or file needing it. Because of this all the available memory space resides at the same place together, which means that the freely/unused available memory partitions are not distributed in a random fashion here and there across the whole memory space.
The main memory is a combination of two main portions- one for the operating system and other for the user program. We can implement/achieve contiguous memory allocation by dividing the memory partitions into fixed size partitions.
2. Non-Contiguous Memory Allocation :
Non-Contiguous memory allocation is basically a method on the contrary to contiguous allocation method, allocates the memory space present in different locations to the process as per it’s requirements. As all the available memory space is in a distributed pattern so the freely available memory space is also scattered here and there.
This technique of memory allocation helps to reduce the wastage of memory, which eventually gives rise to Internal and external fragmentation.
Difference between Contiguous and Non-contiguous Memory Allocation :
|S.NO.||Contiguous Memory Allocation||Non-Contiguous Memory Allocation|
|1.||Contiguous memory allocation allocates consecutive blocks of memory to a file/process.||Non-Contiguous memory allocation allocates separate blocks of memory to a file/process.|
|2.||Faster in Execution.||Slower in Execution.|
|3.||It is easier for the OS to control.||It is difficult for the OS to control.|
|4.||Overhead is minimum as not much address translations are there while executing a process.||More Overheads are there as there are more address translations.|
|5.||Internal fragmentation occurs in Contiguous memory allocation method.||External fragmentation occurs in Non-Contiguous memory allocation method.|
|6.||It includes single partition allocation and multi-partition allocation.||It includes paging and segmentation.|
|7.||Wastage of memory is there.||No memory wastage is there.|
|8.||In contiguous memory allocation, swapped-in processes are arranged in the originally allocated space.||In non-contiguous memory allocation, swapped-in processes can be arranged in any place in the memory.|
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Buddy Memory Allocation Program | Set 1 (Allocation)
- Difference between Static allocation and Stack allocation
- Difference between Static Allocation and Heap Allocation
- Difference between Static and Dynamic Memory Allocation in C
- Non-Contiguous Allocation in Operating System
- MCQ on Memory allocation and compilation process
- Buddy System - Memory allocation technique
- Buddy Memory Allocation Program | Set 2 (Deallocation)
- Stack vs Heap Memory Allocation
- Implementation of all Partition Allocation Methods in Memory Management
- Partition Allocation Methods in Memory Management
- Difference between Volatile Memory and Non-Volatile Memory
- Difference between Byte Addressable Memory and Word Addressable Memory
- Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
- Difference between Virtual memory and Cache memory
- Difference between Uniform Memory Access (UMA) and Non-uniform Memory Access (NUMA)
- Implementation of Contiguous Memory Management Techniques
- Implementing Non-contiguous Memory Management Techniques
- Random Access Memory (RAM) and Read Only Memory (ROM)
- Introduction to memory and memory units
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : ashushrma378