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.|
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Buddy Memory Allocation Program | Set 1 (Allocation)
- Non-Contiguous Allocation in Operating System
- Difference between Static allocation and Stack allocation
- Difference between Static Allocation and Heap Allocation
- MCQ on Memory allocation and compilation process
- Stack vs Heap Memory Allocation
- Buddy System - Memory allocation technique
- Partition Allocation Methods in Memory Management
- Buddy Memory Allocation Program | Set 2 (Deallocation)
- Implementation of all Partition Allocation Methods in Memory Management
- Implementation of Contiguous Memory Management Techniques
- Implementing Non-contiguous Memory Management Techniques
- Difference between Random Access Memory (RAM) and Content Addressable Memory (CAM)
- Difference between Virtual memory and Cache memory
- Difference between Byte Addressable Memory and Word Addressable Memory
- Difference between Register and Memory
- Difference between Memory and Storage
- Difference between Uniform Memory Access (UMA) and Non-uniform Memory Access (NUMA)
- Difference between Primary and Secondary Memory
- Difference between Volatile Memory and Non-Volatile Memory
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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