Contiguous Memory Allocation
Contiguous Memory Allocation
Techniques
This is done by creating fixed-sized memory segments and assigning a single process to each partition.
Therefore, the amount of multiprogramming will be limited by the number of memory-based fixed partitions.
Each process in this method of contiguous memory allocation is given a fixed size continuous block
in the main memory. This means that the entire
➢ Three processes in the
memory will be partitioned into continuous blocks of
input queue in the figure
fixed size, and each time a process enters the above require memory
system, it will be given one of the available blocks space allocation. The .
Because each process receives a block of memory has fixed-sized
memory space that is the same size, chunks because we are
regardless of the size of the process. Static using the fixed size
partition technique. In
partitioning is another name for this approach.
addition to the 4MB
process, the first process,
which is 3MB in size, is
given a 5MB block. The
second process, which is
1MB in size, is also given
a 5MB block. So, it
doesn't matter how big
the process is. The same
fixed-size memory block
is assigned to each.
Advantages
Disadvantages
o We won't be able to allocate space to a process whose size exceeds the block since the size
of the blocks is fixed.
o The amount of multiprogramming is determined by block size, and only as many processes
can run simultaneously in memory as there are available blocks.
o We must assign the process to this block if the block's size is more than that of the process;
nevertheless, this will leave a lot of free space in the block. This open area might have been
used to facilitate another procedure.
o Flexible Partitioning
Method
Advantage:-
Processes are given blocks of space
according to their needs, avoiding internal
fragmentation and RAM waste.
The number and size of processes can vary
depending on the situation, and even large
processes can be given space.
Dis-advantage:-
It is of five types:
It is of two types: 1. Paging
9. 2. Multilevel Paging
1. Fixed(or static) partitioning
3. Inverted Paging
2. Dynamic partitioning
4. Segmentation
5. Segmented Paging
दू सरे शब्ोों में कहें तो, “Non-contiguous मैमोरी एलोकेशन एक method है विसमें एक process
को अलग-अलग memory location में मौिूद memory space आिोंवित (allocate) वकये िाते हैं .”
linked list इस मैमोरी एलोकेशन का एक उदाहरण है क्ोोंवक हम इसमें last node को direct
access नहीों कर सकते.
advantages (इसके फायदे ) –
• इसमें external fragmentation नहीों होता है .
• यह memory की बचत करता है .
disadvantages (इसके नुकसान) –
• इसमें process को execute होने में ज्यादा
समय लगता है . क्ोोंवक process िु कडोों में
अलग-अलग memory locations पर स्थित
होती है .
• non-contiguous memory को control
करना difficult होता है
Fundamental approaches :
• Paging
1. Each process consists of fixed-size components called pages.
2. The size of a page is defined by the hardware of a computer, and
demarcation of pages is implicit in it.
3. The memory can accommodate an integral number of pages.
4. It is partitioned into memory areas that have the same size as a page, and
each of these memory areas is considered separately for allocation to a
page.
5. This way, any free memory area is exactly the same size as a page, so
external fragmentation does not arise in the system. Internal
fragmentation can arise because the last page of a process is allocated a
page-size memory area even if it is smaller than a page in size.
• Segmentation:-
1. a programmer identifies components called segments in a
process.
2. A segment is a logical entity in a program, e.g., a set of
functions, data structures, or objects.
3. Segmentation facilitates sharing of code, data, and program
modules processes.
4. segments have different sizes, so the kernel has to use
memory reuse techniques such as first-fit or best-fit
allocation. Consequently, external fragmentation can arise.