|Basic||Assign consecutive blocks of memory to a process.||Assign separate blocks of memory to a process.|
|Overheads||Contiguous memory allocation does not have the overhead of address translation when executing a process.||Noncontiguous memory allocation has an overhead in address translation when executing a process.|
|Execution rate||A process fades to a contiguous memory assignment||A process runs relatively slower in terms of non-contiguous memory allocation.|
|Solution||The storage space must be divided into a fixed-size partition and each partition is allocated to only one process.||Divide the process into several blocks and place them in different parts of memory based on the availability of available memory space.|
|table||A table is managed by the operating system which maintains the list of available and occupied partitions in the memory space||A table must be maintained for each process that carries the base addresses of each block that has been acquired by a process in memory.|
Definition of contiguous memory allocation
The operating system and user processes must both be contained in the main memory. So the main memory divided into two partitions: in one partition resides the operating system and in other user processes reside. Under normal conditions, different user processes must reside in memory at the same time, and therefore it is important to consider allocating memory to processes.
The memory allocation adjoins one of the memory allocation methods. In contiguous memory allocation, when a process requires memory, one single contiguous section of memory blocks it is assigned to the process according to its needs.
In the variable partitioning scheme, the operating system maintains one table which indicates which partition of free memory and which one occupied by processes. The contiguous memory allocation connects the execution of a process reducing the overhead costs of address translation.
Definition of non-contiguous memory allocation
Noncontiguous memory allocation allows a process to acquire the various blocks of memory in the different position in the memory in according to your needs. The memory allocation is not contiguous decreases also it waste of memory caused due to internal and external fragmentation. Since it uses memory holes, created during internal and external fragmentation.
Paging and segmentation are the two ways in which the physical addressing space of a non-contiguous process. In noncontiguous memory allocation, the process divided into blocks (pages or segments) which are placed in the different area of the memory space according to the availability of the memory.
Noncontiguous memory allocation has the advantage of reducing memory waste, but increases the overhead costs of address translation. Since the parts of the process are placed in a different position in memory, slows down execution memory because time is consumed in address translation.
Here, the operating system must maintain the table for each process which contains the base address of each block that is acquired by the process in the memory space.
Key differences between contiguous and noncontiguous memory allocation
- The fundamental difference between contiguous and noncontiguous memory allocation that contiguous allocation allocates a single contiguous block of memory to the process while the noncontiguous allocation divides the process in several blocks and places them in the different memory address space, that is in a non-contiguous way.
- In contiguous memory allocation, the process stored in a contiguous memory space; therefore not there is address translation overhead during execution. But in the allocation of non-contiguous memory, vi an overhead of address translation during the execution of the process, because the process blocks are distributed in the memory space.
- The process stored in the contiguous memory is executed faster compared to the process stored in non-contiguous memory space.
- The solution for contiguous memory allocation is to divide the storage space into the fixed-size partition and allocate a partition to a single process. On the other hand, in non-contiguous memory allocation, a process divided into several blocks and each block placed in different points of memory in based on memory availability.
- In contiguous memory allocation, the operating system must maintain one table indicating which partition available for the process and which occupied by the process. When allocating noncontiguous memory, one is kept table for every process which indicates the base address of each process block placed in memory space.
The contiguous memory allocation does not create any overload and connects the execution speed of the process but increases the waste of memory . In turn, the allocation of noncontiguous memory creates overloads of address translation, reduces the speed of execution of a process but increases memory usage . So there are pros and cons of both allocation methods.