Difference Between Contiguous and Noncontiguous Memory Allocation

The main difference between contiguous and noncontiguous memory allocation is that the contiguous memory allocation assigns consecutive blocks of memory to a process while the noncontiguous memory allocation assigns separate blocks of memory to a process.

Contiguous and noncontiguous memory allocation are two memory allocation models. Contiguous memory allocation assigns consecutive memory blocks to a process. Noncontiguous memory allocation assigns different blocks of memory in a nonconsecutive manner to a process. In contiguous allocation, it might sometimes be difficult to find a memory block large enough to fit a process. However, in noncontiguous memory allocation, it is easier to find memory blocks at various locations as it does not require consecutive memory blocks.

Key Areas Covered

1. What is Contiguous Memory Allocation
     – Definition, Functionality
2. What is Noncontiguous Memory Allocation
     – Definition, Functionality
3. Difference Between Contiguous and Noncontiguous Memory Allocation
     – Comparison of Key Differences

Key Terms

Contiguous Memory Allocation, External Fragmentation, Internal Fragmentation, Noncontiguous Memory Allocation, Operating System

Difference Between Contiguous and Noncontiguous Memory Allocation - Comparison Summary

What is Contiguous Memory Allocation

In contiguous memory allocation, a single contiguous section of the memory block is assigned to a process. Therefore, a single process exists in one block of the contiguous memory block. To achieve contiguous memory allocation, the memory can be divided into fixed size partitions. Each partition gets a single process.

In internal fragmentation, if a memory allocated for a process is larger than required, then the remaining portion is unused. It cannot be used for some other process. Contiguous memory allocation can cause this internal fragmentation.

Difference Between Contiguous and Noncontiguous Memory Allocation

Contiguous memory allocation can speed up the execution of the process because it minimizes the overheads of address translation. However, it may be difficult to find a contiguous block of memory that is large enough to fit a process.

What is Noncontiguous Memory Allocation

In non-contiguous memory allocation, the process is allocated to several memory blocks at different memory locations in the memory. In internal fragmentation, the memory block assigned to a process is large, so the remaining portions cannot be used for some other process; thus, it remains unused. In external fragmentation, the total memory space is enough to reside a process but it is not contiguous, so it cannot be used. Noncontiguous memory allocation provides a solution for internal and external fragmentation. It minimizes the memory wastage.

Even though noncontiguous memory allocation reduces memory wastage, it has some drawbacks. It causes overhead because of address translation. Furthermore, as the different sections of the same process reside in different memory locations, it can minimize the overall execution speed.

Difference Between Contiguous and Noncontiguous Memory Allocation

Definition

Contiguous memory allocation is a memory allocation model that assigns memory blocks having consecutive addresses to a process. Noncontiguous memory allocation is a memory allocation model that assigns ssigns a process to memory blocks located in different location.

Basis

The contiguous memory allocation assigns consecutive blocks of memory to a process. The noncontinuous memory allocation assigns a process to memory blocks located in different location. It follows a nonconsecutive manner.

Overhead

Overhead is minimum in contiguous memory allocation. It does not have much address translations while executing a process. Noncontiguous memory allocation contains more overheads as there are more address translations.

Execution Speed

A process in contiguous memory executes faster because the whole process is in a sequential block. On the other hand, a process in noncontiguous memory requires more time to execute as it is in different locations of the memory.

Controlling

It is easier for the operating system to control contiguous memory. It is difficult to control noncontiguous memory.

Conclusion

The difference between contiguous and noncontiguous memory allocation is that the contiguous memory allocation assigns consecutive blocks of memory to a process while the noncontiguous memory allocation assigns separate blocks of memory to a process.

Reference:

1. Memory Allocation, Education 4u, 24 Apr. 2018, Available here.

Image Courtesy:

1. “CPT Memory Addressable” By Pluke – Own work (CC BY 3.0) via Commons Wikimedia

About the Author: Lithmee

Lithmee holds a Bachelor of Science degree in Computer Systems Engineering and is reading for her Master’s degree in Computer Science. She is passionate about sharing her knowldge in the areas of programming, data science, and computer systems.

Leave a Reply