Home | | Operating Systems | Contiguous Memory Allocation

# Contiguous Memory Allocation

Each process is contained in a single contiguous section of memory.There are two methods namely : v Fixed – Partition Method v Variable – Partition Method

Contiguous Memory Allocation

Each process is contained in a single contiguous section of memory.

There are two methods namely :

v Fixed Partition Method

v Variable Partition Method

Fixed Partition Method :

· Divide  memory  into  fixed  size  partitions,  where  each  partition  has exactly

one process.

· The    drawback   is    memory   space    unused   within    a    partition    is

wasted.(eg.when process size < partition size)

Variable-partition method:

ü Divide memory into variable size partitions, depending upon the size of the incoming process.

·        When a process terminates, the partition becomes available for another process.

· As  processes complete and  leave they create holes in  the main memory.

·        Hole block of available memory; holes of various size are scattered throughout memory.

Dynamic Storage-Allocation Problem:

How to satisfy a request of size =n‘ from a list of free holes?

Solution:

v First-fit: Allocate the first hole that is big enough.

v Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size. Produces the smallest leftover hole.

v Worst-fit: Allocate the largest hole; must also search entire list. Produces the largest leftover hole.

NOTE: First-fit and best-fit are better than worst-fit in terms of speed and storage utilization

Fragmentation

 External  Fragmentation – This takes  place  when  enough       total memory space exists  to  satisfy  a  request,  but  it  is  not  contiguous  i.e,  storage         is fragmented into a large number of small holes scattered throughout the main memory.

Ø Internal Fragmentation Allocated memory may be slightly larger than requested memory.

Example:

hole = 184 bytes

Process size = 182 bytes.

We are left with a hole of 2 bytes.

Solutions:

Coalescing :Merge the adjacent holes together.

Compaction: Move all processes towards one end of memory hole towards other end of memory, producing one large hole of available memory. This scheme is expensive as it can be doneif relocation is dynamic and done at execution time.

Permit the logical address space of a process to be non-contiguous. This is achieved through two memory management schemes namely paging and segmentation.

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
Operating Systems : Storage Management : Contiguous Memory Allocation |

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.